Interrupting a loop

A

Andrea

I have a macro that loops and within the loop produces and
emails a variety of workbooks. The process can take 15-20
minutes. Is there a graceful way to interrupt the loop at
a set interval other than pressing the escape key and
hoping for the best.

Thank you
 
B

Bob Phillips

You could set a variable to Now before the loop starts, and then within the
loop check Now against that variable le, and if it exceeds a pre-set amount
of time, terminate the loop.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Similar Threads


Top