PDA

View Full Version : Solved: Call a Userform when "Esc" key is press



jammer6_9
01-13-2009, 07:49 AM
I am on a Chart Sheet and I want to call a userform when "Esc" key is press. How can I? :help

Kenneth Hobs
01-13-2009, 09:11 AM
In a Module:
Sub Esc()
UserForm1.Show
End Sub

Right the Chart sheet's tab, View Code, and paste:

Private Sub Chart_Activate()
Application.OnKey "{ESC}", "Esc"
End Sub

Private Sub Chart_Deactivate()
Application.OnKey "{ESC}"
End Sub

jammer6_9
01-13-2009, 11:01 PM
Thanks :friends: