Select the first cell of the last row in a range - Excel 2003
Is this good enough:
Sub ordinate()
Set r = Selection
nFirstColumn = r.Column
nLastRow = r.Rows.Count + r.Row - 1
Set first_cell_in_last_row = Cells(nLastRow, nFirstColumn)
MsgBox (first_cell_in_last_row.Address)
End Sub
--
Gary''s Student - gsnu200842
"Susan Ramlet" wrote:
A co-worker asked me how to programmatically select the first cell of the
last row in a range in Excel 2003 (Windows XP). We found the Help reference
to selecting the last cell in a range, but we couldn't come up with a good
solution for the first cell in the last row, other than a "SendKeys" type of
solution to send "Ctl-down arrow", which is a bit too imprecise.
Neither of us is a strong coder, but he's trying to use a macro to get
there.
Any ideas would be welcome!
--
Susan Ramlet
**please reply to the newsgroup so others may benefit**
|