I have a macro that I use to tally some numbers. It puts up an InputBox, checks the input, loops if the input is invalid. I made the mistake of putting an IsNumeric call immediately after the InputBox. This means that clicking the Cancel button, which I was using to end the run, is now an error. The result is that it loops forever.
Here's a snippet of the code.
I have tried everything I can think of or can find online to interrupt this macro. This is on a Surface Book 1, which has no Break or Pause key.
These include:
- Esc. This is treated jnust like Cancel or Enter.
- Esc several times fast. Same result.
- Ctrl+Esc
- Win + Esc. I think this is also treated like Cancel.
- Win+r (Break?). Rgis bring up the Run window.
- Ctrl+Fn+B. Does nothing.
- Ctrl+Fn+C. Does nothing.
- Ctrl+Atl+Del. I can use this to close the worlbook, but then I lose unsaved changes, both in the workbook and the macro code.
The only thing that works is to force the workbook to close by clicking the "X" on its icon in the list of open workbooks or force the PC to restart. The problem with these solutions is that I lose any edits that I might have made since it was last saved.
There has to be a way to interrupt (close or enter debug) a macro like this.
Thanks