使用VBA跟踪Excel中的更改 – build议?

我有大量的工作簿(〜4500),每个工作簿都有四个工作表,我需要能够跟踪更改。目前,我有以下代码:

Private Sub Worksheet_Change(ByVal Target As Range) Application.ScreenUpdating = False vnew = Target.Value vaddress = Target.Address Application.EnableEvents = False Application.Undo vold = Target.Value If vold = "" Then Target.Value = vnew Target.Interior.ColorIndex = 6 'make this whatever color you want for when it used to be blank ElseIf vold <> vnew Then Target.Value = vnew Target.Interior.Color = RGB(146, 208, 80) 'make this whatever color you want for when the cell changed End If Application.EnableEvents = True Application.ScreenUpdating = True End Sub 

不幸的是,这对于试图复制和粘贴文本块的用户来说是很麻烦的,并且也不理想,因为它停止了使用撤销的能力。 我们已经考虑过使用条件格式,但是必须将所有四张表单复制到“* _old”表单中,或者类似的东西才能比较,似乎并不适用于我们必须使用的大量工作簿。

由于项目需要,我们也不能使用内置的Excel跟踪更改。 我们需要单元格突出显示。

有没有人有任何build议或尝试和真正的方法呢?

顺便说一句,我们现在正在使用Python将macros大批量地导入到工作簿中。