Public Sub SomeMacro()
On Error GoTo PROC_EXIT
Application.EnableCancelKey = xlErrorHandler
' Code that possibly contains a Loop
PROC_EXIT:
Exit Sub
End Sub
Hitting ESC or Ctl-Break will interrupt the loop and transfer control to your error handler which tehn simplu exits the macro
Bookmarks