Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default 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**


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does Excel select a range instead of just the cell clicked on Geekette Excel Discussion (Misc queries) 6 March 2nd 09 08:56 PM
Excel 2003 won't let me select my own regression output range. Peter Excel Discussion (Misc queries) 0 August 24th 07 10:30 PM
Select cell from range based on input in excel xp dingy101 Excel Discussion (Misc queries) 3 November 20th 05 12:05 AM
select first cell in unmerged range Jack Sons Excel Discussion (Misc queries) 2 October 20th 05 03:49 PM
In Microsoft Excel 2003, when I select a color for a cell it does. Jude Excel Worksheet Functions 3 March 13th 05 04:55 PM


All times are GMT +1. The time now is 07:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"