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

excel+training+london - excel vba

Forum home » Delegate support and help forum » Microsoft Excel Training and help » excel+training+london - Excel VBA

excel+training+london - Excel VBA

ResolvedVersion Standard

Alex has attended:
Excel VBA Intro Intermediate course

Excel VBA

What is the line of code to select the range from cell A1 in the active work sheet to the last cell in the range (assume I would have assigned a variable to this last cell)? Hope that makes sense..

RE: Excel VBA

Alex

Youo need to set a variable to hold the defined range. Then you need to set the range as below.

NB The first "A1" sets the start, the second "A1" states that the range to select is only the A column.


Sub SelectRange()

Dim MyRange As Range

Set MyRange = Range("A1", Range("A1").End(xlDown))

MyRange.Select

End Sub


Hope this helps

Carlos

 

Training courses

Training information:

See also:

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:

Shortcut fill a cell with contents from adjacent cells

Use Control + D to fill a cell with the data from an adjacent cell. This speeds up data entry and is a cool tip to share!


View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.14 secs.