find last row in a sheet

G

Guest

EndRow = Cells(Rows.Count, 1).End(xlUp)

I need the last used row count. This statement seems to count the last row
but not the used range. How do I find the last used row?


thanks,
 
C

carlo

EndRow = Cells(Rows.Count, 1).End(xlUp)

I need the last used row count. This statement seems to count the last row
but not the used range. How do I find the last used row?

thanks,

EndRow = Cells(65536,1).End(xlup).row

hth

Carlo
 
D

David McRitchie

(e-mail address removed)...
Sorry didn't read the question properly, ignore my previous answer
modify Carlo's to read -- based on column 1 (Column A), it is
not based on what Excel considers to be the last cell.

EndRow = Cells(Rows.Count,1).End(xlup).row

You can read about lastcell at
http://www.mvps.org/dmcritchie/excel/lastcell.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top