View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default Getting wrong last cell when using usedrange in macro in Excel


i think it gets reset when the workbook is saved then re-opened.
I never use it becaus eits not a safe way to determine the last row used.
use

1)
ActiveSheet.Cells(Rows.Count, "Y").End(xlUp).Row

or
2) more specific
..range("A1").End(xlDown)



"JeffL" wrote in message
...
I've been told that using ActiveSheet.UsedRange will reset the special
cell
LastCell after deleting from a sheet, but Excel says the last cell is at
Y102
when it should be Y10. There is nothing on row 102 at all. What's
happening?