View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pm[_2_] pm[_2_] is offline
external usenet poster
 
Posts: 44
Default Function seems to be late with calculation

hello,

i have function:

Function FindID(c As Variant, x As String, y As Range)

'c - file
'x - sheet
'y - value i'm looking for

s = "=INDEX('" & c & x & "'!C8:EX8,1,MATCH(" & y.Address(1, 1, xlA1, True) & ",'" & c & x & "'!C15:EX15,0))"

FindID = Evaluate(s)

End Function

i call this function as follows:

=IF(B31=".";"";IF(ISERROR(findid($C$5;$B$3;$D31)); "";findid($C$5;$B$3;$D31)))

or simply:

=findid($C$5;$B$3;$D31)

and value is not correctly calculated when i press F9 (i disabled
automatic caluculation). unless i press F9 again values are correctly
calculated

in automatic calculation i have to change some value twice..

why does this function work in this way?

regards