select first cell range

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

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

resolvedResolved · 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 courses

 

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
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Auto-insert the current time

In Microsoft Excel, to enter the current time into a cell, hold CTRL+SHIFT and press SEMICOLON.

View all Excel hints and tips


Server loaded in 0.09 secs.