activating the cancel button on Input boxes

  • Thread starter Thread starter Shane
  • Start date Start date
S

Shane

Hi all, I have a type 8 (range) input box. How can I make the procedure
exit when the user clicks on the cancel icon on the input box without
getting an error.

Many thanks
S
 
dim rng as Range
On Error Resume Next
set rng = Application.Inputbox("Prompt", Type:=8)
On Error goto 0
if rng is nothing then
msgbox "No range selected"
exit sub
End if
 
THANK YOU!!!


Tom Ogilvy said:
dim rng as Range
On Error Resume Next
set rng = Application.Inputbox("Prompt", Type:=8)
On Error goto 0
if rng is nothing then
msgbox "No range selected"
exit sub
End if
 

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

Similar Threads

Cancel Input Box error 16
InputBox buttons 7
Input Box Q 3
Input Box Vs Cancel 6
Input Box 1
Input Box Cancel function 4
Cancel Button Routine 2
Input Box Cancel Button 2

Back
Top