Hello!
I want to count the number of cells greater than the value of a cell but either the counter returns 0 or the number of cells in the range.
Please, Can someone help me?
I want to count the number of cells greater than the value of a cell but either the counter returns 0 or the number of cells in the range.
Please, Can someone help me?
Rich (BB code):
Sub CountCellsWithText()
Dim cellCount As Integer
Dim cell As Range
Dim count As Integer
Dim k As Integer
count = 0
k = 0
For Each cell In Range("I12:K12")
If Cells(cell).Value > Range("G12") Then
k = k + 1
End If
count = count + 1
Next
MsgBox k & "-" & count
End Sub