Count rows
Lol. After I made the same comment earlier as well.
--
HTH
RP
wrote in message
...
Hi Bob,
Thanks very much for your help. Your method works fine.
You might mistyped " ". It should be "".
Hugh
-----Original Message-----
First data row
Private Sub CountRows()
Dim iCount As Long
iCount = 1
While Sheet1.Range("B" & iCount).Value = " "
iCount = iCount + 1
Wend
End Sub
--
HTH
RP
"Hugh" wrote in
message
...
Thank all for your help. I used "" instead of " "
before I
asked help. It did not work and now I know why since my
data rows was not started from row 1. The question is
then: how to detect first data row? Thanks again.
-----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.
.
.
|