User sets range

  • Thread starter Thread starter arts
  • Start date Start date
A

arts

I need a routine that does the following:

1. MsgBox tells user to define a range by highlighting an
area.
2. User clicks OK when done highlighting.
3. VBA saves and names the range.

Can someone steer me in the right direction?
 
Arts

a very basic example, but somewhere to start:

Sub SelectRange()
Dim myRange As Range
Set myRange = Application.InputBox("Please select a range", _
"Range Selection", _
Range("A1:B2").Address, , , , , _
8)
myRange.Select
End Sub

Regards

Trevor
 
-----Original Message-----
Arts

a very basic example, but somewhere to start:

Sub SelectRange()
Dim myRange As Range
Set myRange = Application.InputBox("Please select a range", _
"Range Selection", _
Range("A1:B2").Address, , , , , _
8)
myRange.Select
End Sub

Regards

Trevor


"(e-mail address removed)"


.
 
Back
Top