Count rows
Hi
in your case remove the space between the apostrophes:
Private Sub CountRows()
Dim iCount As Long
iCount = 1
While Sheet1.Range("B" & iCount).Value < ""
iCount = iCount + 1
Wend
End Sub
Or use
icount=application.counta(range("B:B"))
--
Regards
Frank Kabel
Frankfurt, Germany
Hugh wrote:
Hi there,
How to count data rows? I tried following sub. It did not
work.
Private Sub CountRows()
Dim iCount As Long
iCount = 1
While Sheet1.Range("B" & iCount).Value < " "
iCount = iCount + 1
Wend
End Sub
Thanks in advance for your help.
|