excel+training+london - excel vba

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

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

excel+training+london - Excel VBA

resolvedResolved · Low Priority · Version 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


Server loaded in 0.11 secs.