Need number of rows

  • Thread starter Thread starter alsameer
  • Start date Start date
A

alsameer

Is there any function which can return the number of rows present in th
specified sheet.

I remember I have seen one function for this befor somewhere. But no
able to recollect :confused:

thank
 
The question is somewhat ambiguous.
The number or rows in a spreadsheet is dependent on your version
of Excel. What are you looking for and how do you want to use it.

Ctrl+End will take you to the lastcell location which is the intersection
of the last used row an the last used column, but it is more like a high
water mark than a correct location. Some more insight into this can
be found at http://www.mvps.org/dmcritchie/excel/lastcell.htm
 
thanks David.
I got it. "ActiveSheet.UsedRange.Rows.Count"
ur links were really helpful. :)
 
Just to make sure that you are working with what you think you
will be working with -- if you start with an empty sheet so that the
lastrow count will not be messed up and populate cells B3:D4
you will get the following results (nothing is in the first two rows):

ActiveSheet.UsedRange.Rows.Count is 2
Cells.SpecialCells(xlLastCell).Row is 4
ActiveSheet.UsedRange.Address is $B$3:$D$4
 
Back
Top