Hi
I have a userform that's called via a macro.
How can I program the form so that when I press the ESC key it will close it and stop running the program? If I click the X on the form it closes it but I need it to work with the esc key
thanks
Hi
I have a userform that's called via a macro.
How can I program the form so that when I press the ESC key it will close it and stop running the program? If I click the X on the form it closes it but I need it to work with the esc key
thanks
Hello Dohko,
The only time a UserForm processes the KeyUp, KeyDown, and KeyPress events is when there are no controls on the form to take the focus.
Sincerely,
Leith Ross
So if there is an OK button then pressing ESC wont quit the form?
Hello Dohko,
You can if the "OK" button has the focus. The button can process the keyboard input and check for "ESC". Here is an example...
Sincerely,![]()
Please Login or Register to view this content.
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks