problem:

we want to count number of rows in excel with VB

solution:

I create the sub function to count the number of rows depend on where do you want to start!

Sub countRows()
RowCount = 0
RowNext = 22  ( please change the starting row according to your need)
Do While Cells(RowNext, 3).Value <> 0 ( the “3″ also need to be changed)
RowCount = RowCount + 1
RowNext = RowNext + 1
Loop
‘MsgBox RowCount
End Sub