Inputbox Method - cancel Event

R

Rafi

How do I trap a cancel event on the following code?

Set rng = Application.InputBox(Msg1, Title1, Type:=8)

Note the Type=8 (range)

I am trying to trap a CANCEL event as well as an "OK" when the user does not
select a range.

Thanks for your help
 
P

Patrick Molloy

din rng as variant and get rid of the SET word.

You can trap 'CANCEL' easily enough - rng will have teh value'False'

AFAIK though, you can't error outof this type of input as it requires a
range as input.
Alternative ly use your own userform and code up an appropriate input box.
 

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


Top