I am quite new with Excel VBA. What I want to do is create a VBA loop that will count the number of cells below each non empty cells.
col c col d
abc 1
2
3
4
abc 5
6
7
8
9
10
Here's what I've tried so far:
Sub test()
Dim a, b, c, d, i, k As Integer
Dim y As Range
k = Worksheets("Sheet2").Range("d" & Rows.Count).End(xlUp).Row '13
a = 3
b = 3
For i = 4 To k
If IsEmpty(Cells(i, 3)) = True Then
c = c + 1
Else
d = d + 1
End If
Next
MsgBox c
MsgBox d
End Sub
abc
? - Shai Rado