PDA

View Full Version : [SOLVED:] Detecting Change in Value



Opv
05-24-2015, 11:19 AM
Is there a way to detect a change in the value of a cell when the change is the result of a formula within that cell?

The only thing I can think of off the top of my head is to grab the current value of the cell prior to each event (regardless of the source) and then compare that value to the current cell value after the event. Is that the only alternative?

Opv
05-24-2015, 11:59 AM
I solved this issue by restructuring my worksheet and eliminating the need to detect the changed cell.

Paul_Hossler
05-24-2015, 12:00 PM
You might get by with just the _Calculate event



Option Explicit
Dim OldValue As Variant

Private Sub Worksheet_Calculate()
If Range("A1").Value <> OldValue Then
MsgBox "A1 is now " & Range("A1").Value
OldValue = Range("A1").Value
End If

End Sub

Opv
05-24-2015, 12:04 PM
Thanks, Paul. That would indeed work. I'll keep that in mind. I think I'm OK for now.)