XL2000: Custom Function Returns #VALUE! Error After Running Macro

ID: Q213679


The information in this article applies to:
  • Microsoft Excel 2000


SYMPTOMS

If you call a user-defined (custom) function from a worksheet formula, and then run a Microsoft Visual Basic for Applications macro, the user-defined function may return the #VALUE! error.


CAUSE

This problem occurs if all of the following conditions are true:

  • You create a custom function, and then call it from a worksheet formula.

    -and-


  • The custom function uses the Text property for a Range object.

    -and-


  • You run another Sub procedure (macro) that deletes a row in the worksheet.



RESOLUTION

To resolve this problem, use the Value property instead of the Text property in the custom function.

NOTE: If you must use the Text property, recalculate the formulas in the workbook by pressing CTRL+ALT+F9.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

You can use the Text property or the Value property with a Range object. The Value property returns the actual underlying cell value, while the Text property returns the formatted value that is displayed in the cell.


REFERENCES

For more information about the Text property, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type "Text property (Excel)" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Additional query words: XL2000

Keywords : kbprg kbdta KbVBA
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: July 6, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.