ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   .formula property bug? (https://www.excelbanter.com/excel-programming/403432-formula-property-bug.html)

Khuli[_2_]

.formula property bug?
 
I am using some vba which automatically creates a formula in a cell
(it adds successive staterments to the end of an existing formula)
and decided to make it check if the formula length was going to exceed
1,024 characters.

I created a long formula by hand, and in the immediate window typed:

? len(range("A1").formula)

This gave an error, despite the formula being 1,012 characters long.
Changing the formula bit by bit, I found that the above code only
works if the formula is a maximum of 1,000 characters.

Question 1: Is this a bug?

Question 2: How can I check if a formula may exceed 1,024 characters,
if the current length is valid, but checking the length as above gives
an error?

Khuli[_2_]

.formula property bug?
 
On 31 Dec 2007, 12:42, Khuli wrote:
I am using some vba which automatically creates a formula in a cell
(it adds successive staterments to the end of an existing formula)
and decided to make it check if the formula length was going to exceed
1,024 characters.

I created a long formula by hand, and in the immediate window typed:

? len(range("A1").formula)

This gave an error, despite the formula being 1,012 characters long.
Changing the formula bit by bit, I found that the above code only
works if the formula is a maximum of 1,000 characters.

Question 1: Is this a bug?

Question 2: How can I check if a formula may exceed 1,024 characters,
if the current length is valid, but checking the length as above gives
an error?


Gentle bump..

Dave Peterson

.formula property bug?
 
The 1024 is based on the R1C1 reference style.

Try testing your potential formula using .formulaR1C1





Khuli wrote:

I am using some vba which automatically creates a formula in a cell
(it adds successive staterments to the end of an existing formula)
and decided to make it check if the formula length was going to exceed
1,024 characters.

I created a long formula by hand, and in the immediate window typed:

? len(range("A1").formula)

This gave an error, despite the formula being 1,012 characters long.
Changing the formula bit by bit, I found that the above code only
works if the formula is a maximum of 1,000 characters.

Question 1: Is this a bug?

Question 2: How can I check if a formula may exceed 1,024 characters,
if the current length is valid, but checking the length as above gives
an error?


--

Dave Peterson


All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com