View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Calculation order

Hi Ron.

See the discussion by Charles Williams at:

Excel's Calculation Process
http://www.decisionmodels.com/calcsecretsc.htm


---
Regards,
Norman


"Ron Rosenfeld" wrote in message
...
I just came across something interesting, and wonder if someone can point
me to
a discussion.

I noted with regard to a UDF I have to convert Roman to Arabic numerals,
that
the function call seems to affect the worksheet calculation order.

The original function call was:

Function Arabic (rg as range) as Long


With this call, given the following:

A1: some arabic number
A2: =ROMAN(A1)

A3: =Arabic(A2)

A3 appeared to calculate first. So that making a change in A1 would
result in
A3 showing the number that was PREVIOUSLY in A1 instead of the current
number.

Moving the cells around did not make a difference.

What did make a difference was eliminating the Type specification (or
changing
the type specification to Variant) for the variable in the function call:

Function Arabic (rg) as Long

or

Function Arabic (rg as variant) as long

--ron