Thread: Count rows
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Count rows

Thanks all for your reply. I did use "" instread of " "
before I asked help but it did not work. Now I know why
since data row was not started from row 1. The question
is than how to detect first data row? Thanks very much.

Hugh

-----Original Message-----
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.
























.