How to Pause or Stop a running Macro

J

jfeka

I have written the following macro which has the effect
of repeating another macro every 20 seconds. You'll note
that it calls the other sub "upDateHis" and this ends
with calling this one ... in effect creating an endless
loop.


Sub rePeater()

Application.OnTime Now + TimeValue
("00:00:20"), "upDateHis"


End Sub

This is fine most of the time, but there are times when I
don't want this loop running and I'm wondering if someone
can suggest a way to either stop or pause this running
macro that I could activate through a control button in
my worksheet. (I know I can stop it by putting in a
break point in the VB code, but I'd prefer something a
bit more elegant)

What ideas do you have?

Jack
 

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