View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Find the last used Row on a Worksheet

The UsedRange property of the worksheet will get it for you:
LastRow = Worksheets(SheetName).UsedRange.Rows.Count
(this gives the last used row, the blank row would be this plus one)

"poppy" wrote:


Hi Experts

Is it possible for me to select the blank row immediately after the
last used row? I am trying to do something like this, but it's not
working:


Code:
--------------------
lastrow = Cells(Rows.count, "B").End(xlUp).Row
lastrow2 = lastrow + 2
Range("A65536").End(xlToRight).Select = "lastrow2"

OR

Range("lastrow2").End(xlToRight).Select

--------------------


Kind Regards


--
poppy
------------------------------------------------------------------------
poppy's Profile: http://www.excelforum.com/member.php...o&userid=11453
View this thread: http://www.excelforum.com/showthread...hreadid=320060