Thread: count of rows
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default count of rows

Set rng = Intersect(Rows.SpecialCells(xlCellTypeVisible), _
Rows("1:" & Rows.SpecialCells(xlCellTypeLastCell).Row))
MsgBox rng.rows.count

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"kpriyac" wrote in
message ...

I am creating an excel file programatically. Assume I added 10 rows.
I need to write VBA code to see the count of rows in the excel file.
How do I get this. There is a hidden list in the excel file with 500
rows or so. I do not want the count to reflect these rows. I only want
the count for the 10 rows that I added. how is it done? Would having
hidden rows for validation make a difference to the count of rows?


--
kpriyac
------------------------------------------------------------------------
kpriyac's Profile:

http://www.excelforum.com/member.php...o&userid=37535
View this thread: http://www.excelforum.com/showthread...hreadid=573206