1

I have a UserForm with two buttons and a number of check boxes: Userform

How do I configure the form so that I can Cancel/ Escape it with the Esc key?

cxw
  • 16,685
  • 2
  • 45
  • 81
VBAbyMBA
  • 806
  • 2
  • 12
  • 30
  • 1
    Or you can do it like this: http://stackoverflow.com/questions/20240677/close-userform-with-escape-button – Mikael May 31 '16 at 13:52

1 Answers1

4

Make sure there is a "Cancel" button on the UserForm, and set the Cancel property of that button to True. In the code for that button, execute Unload Me, Me.Hide, or however you want to exit the userform. E.g., this answer.

Community
  • 1
  • 1
cxw
  • 16,685
  • 2
  • 45
  • 81