View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default Inputbox Method - cancel Event

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.



"Rafi" wrote:

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