XL5: "Error in Formula" Using FormulaArray PropertyLast reviewed: December 19, 1996Article ID: Q121323 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you use the FormulaArray property in a Visual Basic procedure to enter a formula as an array, you receive the following error message:
Run-time error '1005': Error in formula CAUSEYou receive this error message when you use the A1 reference style in the value of the FormulaArray property. For example, you receive this error message when you run a procedure that contains the following statement:
Range("A2").FormulaArray = "=Sum(B1:B2)"Note that you can use either the A1 reference style, or the R1C1 reference style in the Formula property, which is similar to the FormulaArray property.
WORKAROUNDTo avoid receiving this error message when you use the FormulaArray property, use the R1C1 reference style for references, as in the following example:
Range("A2").FormulaArray = "=Sum(R1C2:R2C2)"Microsoft provides examples of Visual Basic procedures 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 Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 5.0c for Windows.
MORE INFORMATIONYou can use the FormulaArray property to return or set the formula of a range, entered as an array. The property returns or enters a single formula or a Visual Basic array. You can use the Formula property to return or enter a formula for a range of cells, or for an object.
REFERENCESFor more information about the FormulaArray Property, choose the Search button in the Visual Basic Reference and type:
FormulaArray Property |
KBCategory: kbprg kberrmsg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |