In this answer, it's shown that Excel userforms can be closed with Esc by setting up a control_KeyPress() sub for each control that can take focus - Close userform with escape button
I've gotten this to work, but I have several menus, each with a number of controls. I tried putting this routine on just one button, but it's not always quick to tab/nav back to a specific button.
I'm looking for a way to make it so that I either
- don't have to create control_KeyPress() subs for every control that can take focus
- or, can achieve the same goal (closing the userform with esc) in a different way
Thanks!