Forum 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?
For upcoming training course dates see: Pricing & availability
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.
|
