Hi - How do I add another variable to this code? I want it to count how many times "Apple" or "Pear" appear in the column?
Code:
With Sheet1 Dim x As Long
x = .Range("A" & Rows.Count).End(xlUp).Row
Dim cnt As Integer
cnt = 0
For i = 1 To x
If .Cells(i, 1).Value = "Apple" Then
cnt = cnt + 1
End If
Next i
.Range("C1").Value = cnt
End With