The information in this article applies to:
SYMPTOMSWhen you calculate your worksheet, some cells may appear to have calculated the wrong value. CAUSEThis problem occurs when the following conditions are true:
WORKAROUNDTo work around this problem, use any of the following methods. Method 1: Modify Your Function So That All Relevant Cell Ranges Are PassedModify your function to accept as arguments all of the cells necessary to calculate the result of the function.Method 2: Make Your Custom Function VolatileMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft Support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:http://www.microsoft.com/support/supportnet/overview/overview.aspIf you make your custom function volatile, this problem will not occur. To make your custom function volatile, add the following line of code to the function: NOTE: If you make your custom function volatile, it will recalculate every time you make a change to a value or recalculate an open workbook. This could impact the performance of your worksheet model.
Method 3: Force Excel to Recalculate All Open WorkbooksPress CTRL+ALT+F9 to recalculate the values in all open workbooks.MORE INFORMATIONExample of the ProblemTo illustrate this problem, follow these steps:
If you implement method 1 in the "Workaround" section of this article, the function will calculate the expected result. The following line of code illustrates how to modify the function in this example so that the expected result is calculated:
Now, if you replace the function call in step 7 with the following function call, the function will always return the expected result.
Additional query words: XL2000 udf user defined function recalc
Keywords : kbdtacode xlvbainfo xlformula |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |