Ming,
Try something like the following:
Dim Rng As Range
On Error Resume Next
Set Rng = Application.InputBox(prompt:="Select a range", Type:=8)
If Rng Is Nothing Then
MsgBox "no range selected"
Else
MsgBox "You selected: " & Rng.Address
End If
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (E-Mail Removed)
"Ming Ma" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, All:
> Can anyone tell me how to write a macro that asks a user to select a range
> in excel? then I would like to use values in the selectionfor other
> calculation later on.
>
> Thanks
>
>