How do you use vbOKCancel to exit out of a macro? Here is my attempt, but even though I press cancel, my macro continues running.
Please Login or Register to view this content.
How do you use vbOKCancel to exit out of a macro? Here is my attempt, but even though I press cancel, my macro continues running.
Please Login or Register to view this content.
Try this
Please Login or Register to view this content.
Thanks, it worked if false is used without quotation marks.
Wait,
When I tried to use the macro, it exited before completing its task even though I didn't click cancel. The problem is only in the last prompt (i.e. if I get rid of the vbCancel mechanism here, it works even though they are in the other ones). What can I do?
If I delete this, it works, however, I want the option of cancelling out of this box.Please Login or Register to view this content.
Please Login or Register to view this content.
Last edited by juliorevka; 03-08-2012 at 04:28 PM.
This seems to work OK.
Please Login or Register to view this content.
BTW, InputBox does not have a Buttons argument, it only has OK and Cancel buttons. So, where you are putting vbOKCancel, that is not setting the buttons, it is setting a default value of 1 (vbOKCancel is a constant value 1).
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks