无法在中断模式下执行宏 [英] Cannot execute macro in Break Mode
问题描述
Sub add()$ b我正在尝试编写一个简单的宏来为单元格的当前值添加1: $ b MsgBox Selection.Value
Selection.Value = Selection.Value + 1
End Sub
当我点击(数字)单元格并尝试运行宏时,我收到以下错误消息:
不能执行休息模式
我缺少什么?
您已经执行了一个宏,并以某种方式停止执行(例如,由于未处理的错误或因为您按下 Ctrl - kbd>执行期间)。在这种状态下,您无法执行另一个宏。
在Visual Basic编辑器中,您需要按停止按钮:
然后你可以运行宏。
如果要了解当前执行停止的位置,请右键单击该代码,然后选择显示下一个语句。如果您按 F8 ,您可以逐步浏览代码。 F5 继续执行。
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 Ctrl-Break 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 F8 you can step through the code. F5 continues the execution.
这篇关于无法在中断模式下执行宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!