How to disable UDF while executing other sub
How to disable UDF while executing other sub
(OP)
I have a spreadsheet with a few user-defined function used in the worksheets. To speed up execution of other routins I need to temporarily disable UDF.
Thanks for your help!
Thanks for your help!





RE: How to disable UDF while executing other sub
I haven't checked, but surely that switches off recalculation of all functions, including UDFs.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: How to disable UDF while executing other sub
I cannot turn off all calculations,I still rely on worksheet formulas to do most of the work.
RE: How to disable UDF while executing other sub
Function CalcIf(...)
If Range("RecalcFlag").Value = 1 Then
UDF code
Else
CalcIf = Application.Caller.Value
End If
End Function
Then you can set RecalcFlag to 0 whenever you don't want the UDF to recalc, but still show the original value. If you use that you will have to allow circular references (otherwise you get a warning message the first time any cell referenced by the function recalculates). I can't see a way to avoid that at the moment.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: How to disable UDF while executing other sub
What would you be doing, if you knew that you could not fail? Ans. Bonds and derivative brokering.
RE: How to disable UDF while executing other sub
=====================================
(2B)+(2B)' ?