Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewValue, OldValue
If Target.Address <> "$A$1" Then Exit Sub
Application.EnableEvents = False
With Target
NewValue = .Value
Application.Undo
OldValue = .Value
.Value = NewValue
End With
MsgBox "Old Value: " & OldValue & vbCrLf & "New Value: " & NewValue
Application.EnableEvents = True
End Sub
Thanks,
It's a good way to do it! However I am using a user form to change the content of the cell and so the undo is not working...
Is there another way?
Hi,In that case why not assign the cell's value to a variable before changing it?