Excel formula
Hi,
You would have to adapt it to your needs :
Private Sub Worksheet_Change(ByVal Target As Range)
' stores old and new values for calculations
Dim OldVal As Variant, NewVal As Variant
If Target.Count 1 Then Exit Sub
Application.EnableEvents = False
NewVal = Target.Value
Application.Undo
OldVal = Target.Value
'Your own calculation using NewVal + OldVal
Target.Value = NewVal
Application.EnableEvents = True
End Sub
HTH
Cheers
Carim
|