问题描述
Sub add()$ b我正在尝试编写一个简单的宏来为单元格的当前值添加1: $ b MsgBox Selection.Value
Selection.Value = Selection.Value + 1
End Sub
当我点击(数字)单元格并尝试运行宏时,我收到以下错误消息:
不能执行休息模式
我缺少什么?
您已经执行了一个宏,并以某种方式停止执行(例如,由于未处理的错误或因为您按下 - ,您可以逐步浏览代码。 继续执行。
I am trying to write a simple macro to add 1 to the cell's current value:
Sub add()
MsgBox Selection.Value
Selection.Value = Selection.Value + 1
End Sub
I receive the following error message when I click a (numeric) cell and try to run the macro:
Cannot Execute in Break Mode
What am I missing?
You are already executing a macro and somehow stopped its execution (e.g. due to an unhandled error or because you pressed - during the execution). In this state, you cannot execute another macro.
In the Visual Basic Editor, you need to press the Stop button:
Then you can run the macro.
If you want to understand where the current execution is stopped, right click the code and select Show Next Statement. If you then press you can step through the code. continues the execution.
这篇关于无法在中断模式下执行宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!