ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Stop macro with userform (https://www.excelbanter.com/excel-discussion-misc-queries/152217-stop-macro-userform.html)

Jeff

Stop macro with userform
 
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

Jim Rech

Stop macro with userform
 
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
"Jeff" wrote in message
...
| 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




All times are GMT +1. The time now is 07:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com