1. That the used range changes after a save, or
2. That there doesn't seem to be a way other than Save to
compact the used range. >>
Hi Joe,
I'm afraid MS considers both as features. The following code can be used
to find, and name, the "real" last cell, if you define this as the
bottom right hand corner of the rectangle which contains all cells
holding data:
Sub NameLastRealCell()
Dim ReallastRow As Long
Dim RealLastColumn As Long
ReallastRow = _
Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
RealLastColumn = _
Cells.Find("*", [A1], , , xlByColumns, xlPrevious).Column
Cells(ReallastRow, RealLastColumn).Name = "LastRealCell"
End Sub
Regards,
John Green
Sydney
Australia
Microsoft MVP - Excel
> Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
Thanks.
I was going to use Find(), but I didn't like the fact
that Find() was the same as Excel's Find... command
and it changed its state.
Anyway, it'll do for now.
Complain, complain, complain...
Joe