【发布时间】:2014-12-21 17:43:06
【问题描述】:
我的 Excel 工作簿中有以下 VBA 代码:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Font.ColorIndex = 3
If Target.Column = 1 Then
Target.Interior.ColorIndex = 2
End If
End Sub
我发现,撤消功能丢失了。我在网上搜索了一下,发现是这样的:
Building Undo Into an Excel VBA Macro 但是,这只会撤消上次执行的 VBA 代码的更改,而不是在我的工作簿中不使用 VBA 代码所做的任何其他更改,例如撤消复制和粘贴
我已经在代码中添加了这个,但仍然没有运气!
Application.OnUndo "Primary Macro", "UndoPrimary"
这是我的 Mac 上出现的消息,与我使用 Windows7 PC 时出现的消息类似
【问题讨论】:
-
请发布您的
undoPrimary的代码
标签: vba excel excel-formula