View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Need syntax help!

Hi FCC,

Try:

'=============
Public Sub Tester()
Dim LastRow As Long
Const FirstRow As Long = 5
Dim iRows As Long

LastRow = Cells(Rows.Count, "A").End(xlUp).Row

iRows = LastRow - FirstRow + 1

MsgBox "Number of rows = " & iRows

End Sub
'<<=============


---
Regards,
Norman


"FCC" wrote in message
...

Hello,

I am simply trying to figure out how many rows of information exists in
my spreadsheet, but I've googled and googled and I can't find the
correct syntax for the code.

Basically. I am starting at like cell A5 and then I just want to count
how many rows of below it (like cell A6, A7) have information in them.
And the code should stop immediately when a cell is empty.

Anyone know the syntax for the code like this?


--
FCC
------------------------------------------------------------------------
FCC's Profile:
http://www.excelforum.com/member.php...o&userid=35888
View this thread: http://www.excelforum.com/showthread...hreadid=557210