![]() |
find last row on a worksheet
I'm sure this is easy but I can't seem to figure it out.
How do get a row count on a worksheet? I wrote code that will delete blank rows but every spreadsheet is different and the code keeps running to overflow |
find last row on a worksheet
I wrote code that will delete blank rows
I have some examples on this page http://www.rondebruin.nl/delete.htm Post back if you need help -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "tracey" wrote in message ... I'm sure this is easy but I can't seem to figure it out. How do get a row count on a worksheet? I wrote code that will delete blank rows but every spreadsheet is different and the code keeps running to overflow |
find last row on a worksheet
Hi, Tracey. I do it like this:
Dim LastRow As String LastRow = Range("AD65536").End(xlUp).Row Then use LastRow any time I need to identify that row (as in Range("D" & LastRow).Select or Loop Until ThisRow LastRow. HTH Ed "tracey" wrote in message ... I'm sure this is easy but I can't seem to figure it out. How do get a row count on a worksheet? I wrote code that will delete blank rows but every spreadsheet is different and the code keeps running to overflow |
find last row on a worksheet
Ed,
LastRow should be Dim'ed as Integer or Long, not String, as it is a number. Also, this LastRow = Range("A" & Rows.Count).End(xlUp).Row is a little more flexible. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Ed" wrote in message ... Hi, Tracey. I do it like this: Dim LastRow As String LastRow = Range("AD65536").End(xlUp).Row Then use LastRow any time I need to identify that row (as in Range("D" & LastRow).Select or Loop Until ThisRow LastRow. HTH Ed "tracey" wrote in message ... I'm sure this is easy but I can't seem to figure it out. How do get a row count on a worksheet? I wrote code that will delete blank rows but every spreadsheet is different and the code keeps running to overflow |
All times are GMT +1. The time now is 04:46 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com