Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

First Blank Row

0 views
Skip to first unread message

John Green

unread,
Jul 6, 1997, 3:00:00 AM7/6/97
to

In article <01bc8990$160d7d50$720100c8@adjib> on Sat, 05 Jul 1997
15:18:28 -0700 "Joe Latone" <lat...@sphinx.com> wrote:
<< But, either of the following I consider a bug:

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


Joe Latone

unread,
Jul 6, 1997, 3:00:00 AM7/6/97
to

> 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

0 new messages