Inputbox Method - cancel Event

  • Thread starter Thread starter Rafi
  • Start date Start date
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
 
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.
 
Back
Top