MSForms cancel

  • Thread starter Thread starter Tritan
  • Start date Start date
T

Tritan

I'm trying to check when the esc key is hit on an MSForm
in Excel. I used to do a lot of VB programming a long
time ago with VB 2 & 3 I thought that all I had to do was
check the value of keypress for the form. But I must be
missing something.

Does anyone have a quick snipet that checks to see if the
esc key was pressed and calls the terminate or a close
method for the form?

Thanks.
Tritan
 
You can set the cancel property of a commandbutton to True and if escape is
pressed, the click event for that button will fire.

Regards,
Tom Ogilvy
 
Back
Top