User sets range

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?
 
T

Trevor Shuttleworth

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
 
A

arts

-----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


"[email protected]"


.
 
Top