Unable to execute macro in break mode
I am trying to write a simple macro to add 1 to the current value of a cell:
Sub add()
MsgBox Selection.Value
Selection.Value = Selection.Value + 1
End Sub
I am getting the following error when I click on a (numeric) cell and try to run a macro:
Cannot Execute in Break Mode
What am I missing?
+3
source to share
3 answers
You are already running the macro and somehow stopped running it (for example, due to an unhandled error or because you pressed Ctrl- Breakduring execution). In this state, you cannot execute another macro.
In the Visual Basic editor, you need to click the Stop button:
Then you can run the macro.
If you want to understand where the current execution stopped, right-click the code and choose Show Next Report. If you then click F8, you can step through the code. F5continues execution.
+10
source to share