View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Melanie Breden Melanie Breden is offline
external usenet poster
 
Posts: 88
Default Excel2000: finding last row of used range

Hi Arvi,

Arvi Laanemets schrieb:
In my procedure I need to determine last used row on worksheet, and I tried
with:
LastRow = Sheets("SheetName").Cells.SpecialCells(xlCellTypeL astCell).Row

At start it looked fine - until I found, that when I p.e. delete some rows
from used range, the SpecialCells(xlCellTypeLastCell) isn't actualized until
I haven't saved my workbook.


try this:

LastRow = Sheets("SheetName").Cells.Find("*", searchdirection:=xlPrevious).Row

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)