In Cell A1, I have formula that recalculates automatically every one to two seconds. When this cell recalculate, the old values from A1 is copied to cell B1. Every time it recalculates, I just want to get a running total. So far, what works is when there is a change in A1, the old value is copied to B1, but unable to get a running total every time it does this. The problem is i
is always equal to 1. Any ideas?
Private Sub Worksheet_Calculate()
Dim dProfit As Double
Dim i As Integer
dProfit = Me.Range("A1").Value
Application.EnableEvents = False
If dProfit >= 1 Then
i = i + 1
MsgBox "calculation detected is " & dProfit & " i= " & i
Range("$B1") = dProfit
Application.EnableEvents = True
End If
End Sub