我正在尝试编写一个简单的宏来将单元格的当前值加 1:
Sub add()
MsgBox Selection.Value
Selection.Value = Selection.Value + 1
End Sub
当我单击(数字)单元格并尝试运行宏时,我收到以下错误消息:
Cannot Execute in Break Mode
我缺少什么?
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:
然后就可以运行宏了。
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.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)