98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Select first cell of a range
Select first cell of a range
Resolved · Low Priority · Version 2003
Scott has attended:
Excel VBA Intro Intermediate course
Select first cell of a range
Hi,
If the user selects a given range, for example , B3:B9, how can I easily work out the first of the range - i.e. B3?
RE: Select first cell of a range
Hi Scott
Thanks for your question, and first let me apologise for the delay in responding.
The following code will carry out the action you require. it assigns the first cell of the selected range to a range variable and then displays that cell's address in a message box
Dim rngMyRange As Range
Set rngMyRange = Selection
MsgBox rngMyRange.Cells(1, 1).Address
Hope this is useful
Regards
Stephen
Thu 23 Apr 2009: Automatically marked as resolved.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Auto-insert the current timeIn Microsoft Excel, to enter the current time into a cell, hold CTRL+SHIFT and press SEMICOLON. |