Asking to Select a Range

I

Irailson

Hi people,

I´m trying to do a macro that asks the user to select a range. , and
then get the address selected. How can I display the select-range box
inside the program?
Thanks for any help

Irailson
 
R

Ron de Bruin

Small example from Help

Sub test()
Worksheets("Sheet1").Activate
Set mycell = Application.InputBox( _
prompt:="Select a cell", Type:=8)
mycell.Select
End Sub
 
D

Dave Peterson

You can put up an application.inputbox and retrieve the range:


dim myRng as range
set myrng = nothing
on error resume next
set myrng = application.inputbox(prompt:="Point and click", type:=8)
on error goto 0
if myrng is nothing then
'use cancelled.
exit sub '???
end if

msgbox myrng.address(external:=true)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top