Gruppe
Ereignis
Problem
Änderungen in diesem Arbeitsblatt sollen unter Angabe der Zelleadresse und des vorherigen Wertes im Blatt "Protokoll" protokolliert werden.
ClassModule: Tabelle1
Private Sub Worksheet_Change(ByVal Target As Range)
Dim vNew As Variant, vOld As Variant
Dim iRow As Integer
If Intersect(Target, Range("A1:E12")) Is Nothing Then Exit Sub
vNew = Target.Value
Application.EnableEvents = False
On Error GoTo ERRORHANDLER
Application.Undo
vOld = Target.Value
Target.Value = vNew
With Worksheets("Protokoll")
iRow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
.Cells(iRow, 1).Value = Target.Address(False, False)
.Cells(iRow, 2).Value = vOld
End With
ERRORHANDLER:
Application.EnableEvents = True
End Sub