Cell A1=1, A2=1, A3=A1*A2Do you want to put the new A1 value in A4 or the previous A1 value?
What about A3 < A3 previous value - should A4 be cleared?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x#, y#
If Target.Address <> "$A$1" Then Exit Sub
Application.EnableEvents = False
x = [A1]
y = [A3]
Application.Undo
If [A3] < y Then [A4] = x
[A1] = x
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x#, y#, z#
If Target.Address <> "$A$1" And Target.Address <> "$A$2" Then Exit Sub
Application.EnableEvents = False
x = [A1]
z = [A2]
y = [A3]
Application.Undo
If [A3] < y Then [A4] = x
[A1] = x
[A2] = z
Application.EnableEvents = True
End Sub
Sorry brother, It's lack of my English knowledge. If I'd explained like this before you'd understand well.This is the first time you've mentioned that you also want to change A4 if A2 is changed - you previously only mentioned a change in A1,