View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Application.Iteration in UDF

Charles,

I did not know that. Thanks for the info.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Charles Williams" wrote in message
...
If you write a UDF that is either in or dependent on the circular chain it
will be executed repeatedly. You can detect whether the UDF is being
calculated during the first or second step of the calculation process by
checking Application.Iteration. This will be False during the first step
and True during the second step.

regards
Charles
_________________________________________
FastExcel 2.3
Name Manager 4.0
http://www.DecisionModels.com

"Chip Pearson" wrote in message
...
In general, a user defined function (UDF) cannot change any part of the
Excel environment. It can do nothing but return a value to the cell from
which it was called. Normally, attempting to change anything else will
cause the UDF to terminate immediately and return a #VALUE error to the
calling cell. I don't know why setting the Iteration property doesn't
cause a #VALUE error but it doesn't surprise me that you cannot set its
value in a UDF. Functions called from worksheet cells have much more
restrictions than code executed directly.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Mitch Powell" wrote in message
...
Using Tools, Options, Calculation, I set Iterations to TRUE. When my
user-defined function retrieves the value of Application.Iteration, it
is
FALSE, even though I just set it to TRUE using the user interface.

Any idea why?