Excel application screenupdating does not work
If this happens you may need to explicitly recalculate your function.For optimum performance UDFs should be coded in C and use the C API.
I recommend that you do not attempt to program a UDF to handle multi-area ranges as arguments: use multiple (optional if there are a varying number) range arguments instead.If you then do a sheet.calculate or shift/F9 Excel will not only calculate the currently selected worksheet(s), but will also evaluate all the instances of the UDF that are not on the currently selected worksheets.You should make sure that you have an On Error handler in your UDF to handle both real errors and errors that are caused by out of sequence execution.See Areas Bug Bypass2for a download containing two workbooks that illustrates the problem and a way of bypassing it..
The problem occurs when: In these circumstances Excel/VBA incorrectly treats the multi-area range as referring to the active sheet.
Excel97 If you start the calculation process using Shift-F9 or F9 this problem does not occur: all cells are calculated and debug mode is not entered. Has Formula These expressions will only return true if the cell is both uncalculated and contains a formula.