ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inputbox Method - cancel Event (https://www.excelbanter.com/excel-programming/423708-inputbox-method-cancel-event.html)

Rafi

Inputbox Method - cancel Event
 
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



Patrick Molloy[_2_]

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




All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com