Runaway Macros!

S

shy1162

I have a macro with nested loops and some times it does no want to
stop. Hitting ESC does not always work right away. Can I put a command
inside the loop to pause and look for the ESC key?
 
M

Mike S

I have a macro with nested loops and some times it does no want to
stop. Hitting ESC does not always work right away. Can I put a command
inside the loop to pause and look for the ESC key?

Did you use Doevents inside at least one of the loops, if not each loop?


Discussions that may be interesting:

http://www.mrexcel.com/forum/showthread.php?t=19342

http://www.blog.methodsinexcel.co.uk/2008/10/22/do-events-examples-in-vba/

http://www.mrexcel.com/forum/showthread.php?t=36052


Definition of DoEvents in Visual Basic for Applications

http://support.microsoft.com/kb/118468

Mike
 
D

Don Guillett Excel MVP

I have a macro with nested loops and some times it does no want to
stop. Hitting ESC does not always work right away. Can I put a command
inside the loop to pause and look for the ESC key?

As ALWAYS, post your code for comments
 
R

rumkus

I have a macro with nested loops and some times it does no want to
stop. Hitting ESC does not always work right away. Can I put a command
inside the loop to pause and look for the ESC key?

No.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top