Stop macro with userform

G

Guest

Hi,

I have a userform where you input data, then a macro runs through 1000
scenarios.
I have another userform that pops up after the main userform - this displays
what scenario the macro is on.

My question is: Is it possible to add a "Stop" switch to the userform that
will stop the macro? You can press ctrl-alt delete but I wanted a more
professional looking solution.

Thanks for your help
 
J

Jim Rech

I'd suggest that your stop message tells the user to press Esc to terminate
the process. Use Application.EnableCancelKey = xlErrorHandler (see Help) to
have an error handling macro take over from there.

--
Jim
| Hi,
|
| I have a userform where you input data, then a macro runs through 1000
| scenarios.
| I have another userform that pops up after the main userform - this
displays
| what scenario the macro is on.
|
| My question is: Is it possible to add a "Stop" switch to the userform that
| will stop the macro? You can press ctrl-alt delete but I wanted a more
| professional looking solution.
|
| Thanks for your help
 

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