Reason for calculation...

  • Thread starter Thread starter Dag Johansen
  • Start date Start date
D

Dag Johansen

Hi,

is it possible to know in a custom function whether the
function is called as a result of one of it's dependants
having changed?

Example:

Cell formula "=myF(A5, C5)"

myF is now called if the value of cell A5 is updated. I
would like, in myF(), to detect this particular scenario.

Happy coding,

Dag
 
Hi Dag,

One approach would be to store the values of the arguments in static
variables and compare.
You would have to use ISEMPTY to check for the case where the function is
called more than once per calculation cycle.
(see http://www.decisionmodels.com/calcsecretsj.htm)

of course in a normal recalculation of a non-volatile function the function
only gets called when one or more of its precedents change anyway (apart
from the multiple calls per recalculation problem). But inside a custom
function I do not know of a way of detecting which calculation method is
being used (full,recalc,sheet etc).


regards
Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com
 
Back
Top