Hi All, I am trying to get a piece of macro that will allow me to create a command which ends the macro while running. I know that the standard command is ctrl+break, but I don't want my users to end the macros prematurely so I disabled that command like this:
On Error Goto MyErrorHandler:
Application.EnableCancelKey = xlErrorHandler
MyErrorHandler:
If Err.Number = 18 Then
MsgBox "Stop hitting ctrl + break !!!"
Resume
End If
Now I would like to have the option to stop the code while I am running it by creating something else which causes the script to stop. My idea would be something like this but I'm not quite sure how to write it properly:
On Key Press "ctrl+delete"
Exit Sub
Bookmarks