Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Halting a Macro

Status
Not open for further replies.

James1981

Programmer
Nov 2, 2002
76
0
0
US
Hi,

Is there anyway to stop a macro from running in VBA/Excel?

The only thing I can find is Application.Quit but I don't want to close the Workbook...

James
 
try using End, this will completely end any code that is running but wont shut down the application. Or you can also use Exit Sub which will end the current macro or sub procedure that you are in.

This help?
 
ESC key or a combination {CTRL}+{pause/break} breaks the code execution.
However, if Application.EnableCancelKey is set to xlDisabled, you can't break the code.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top