0

I have a VBA macro for Excel that may take a long time to process. In addition, in the beginning, I open another worksheet to get some data. While this is happening, nothing appears to be going on on the screen. I have a modeless userform that I want to display to indicate that processing is happening.

I'd like to put a command button on this userform that the user can click to stop the processing if they choose. The problem is that when the userform is displayed, if I move the cursor over it, the cursor is an hourglass, and clicking on the button does nothing.

Any suggestions?

TychaBrahe
  • 51
  • 4
  • Implement [DoEvents](https://msdn.microsoft.com/en-us/library/office/gg264522.aspx) into your macro to allow a user to press the `Cancel` button on your form. Alternatively, just state in your form that the user may [press Esc](http://www.excel-easy.com/vba/examples/interrupt-a-macro.html) at any time to halt the macro. – Ralph Aug 22 '16 at 21:08
  • Unfortunately, Esc doesn't really work. I put a code at the bottom of the data before starting processing so that I end processing if I hit that code. I have accidentally told a routine to switch to a different column and wound up 30,000 rows down in a set of data that only had a few hundred rows. Pressing Esc didn't work for me. I usually had to End Task out of Excel. – TychaBrahe Aug 25 '16 at 16:57

0 Answers0