PDA

View Full Version : Am stuck! how do I force exit a macro?



menos
01-10-2011, 08:41 AM
I'm such a muppet! I am running a for-next loop using a vbyesno response to move to the next event, unfortunately I specified it wrong and it is now looping through 8640 cells each requiring me to click yes or no to move on. If I force exit excel I'll lose some unsaved code. Is there a way to stop the macro running?

GTO
01-10-2011, 08:47 AM
Try CTRL + Pause keys

menos
01-10-2011, 09:04 AM
It didn't work, but then nothing has, and now excel has stopped responding. So I'll have to put it down as a learning experience and will hopefully remember to save as I go in future. Thanks for the speedy response!

GTO
01-10-2011, 09:10 AM
I'm sorry that didn't work :-( A total guess, but you might want to use a yes/no/cancel and bail the procedure if cancel is chosen.

menos
01-10-2011, 09:18 AM
Ah thanks, good tip. from now on I will use vbyesnocancel