...
...
Then it seems to me that the change event is probably a better place to put
this sort of thing since one can tell if the cell in question was affected
by the change. Is there any reason not to do this along the lines of the
code I posted previously?
Formula value changes due to recalculation don't trigger Change event handlers.
Only actual entries into cells trigger Change event handlers. So Change envent
handlers won't run when some formula changes value.
Enter =RAND() in cell A1 of some worksheet. Then add the following code to that
worksheet's VBA class module.
Private Sub Worksheet_Calculate()
MsgBox "Calc Trigger"
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
MsgBox "Change Trigger - " & Target.Address(0, 0, xlA1, 1)
End Sub
Go back to the worksheet and press [F9]. Which event handler fires?