Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ActiveCell.FormulaArray code - Get error

Hi,

I have a formula I am running in a workbook to calculate
the averages of a column based on values in another
column. I ran this same code on another workbook last
week without any problems, but this time I am getting the
Run Rime Error -

1004 - Unable to Set the FormulaArray Property of the
Range Class

ActiveCell.FormulaArray = "=IF(ISERROR(AVERAGE(IF
([NUMEARNEST_30_60d_" & EDate & ".xls]30d_win!$B$4:$B" & _
lRow & "=C10,[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow
& "))),0.000,AVERAGE(IF([NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$B$4:$B$" & lRow & "=C10,
[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow & ")))"

The formula works fine if I manually enter it and create
the array, only in VBA does it give the error. I'm using
XCL '02. How can I get around this error. I have lots
of these calculations to do for many dates.

Thx a bunch!

Kohai
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveCell.FormulaArray code - Get error

I believe a formulaArray formula is restricted to a length of 255 characters
and yours appears to be longer than that.

--
Regards,
Tom Ogilvy

"Kohai" wrote in message
...
Hi,

I have a formula I am running in a workbook to calculate
the averages of a column based on values in another
column. I ran this same code on another workbook last
week without any problems, but this time I am getting the
Run Rime Error -

1004 - Unable to Set the FormulaArray Property of the
Range Class

ActiveCell.FormulaArray = "=IF(ISERROR(AVERAGE(IF
([NUMEARNEST_30_60d_" & EDate & ".xls]30d_win!$B$4:$B" & _
lRow & "=C10,[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow
& "))),0.000,AVERAGE(IF([NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$B$4:$B$" & lRow & "=C10,
[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow & ")))"

The formula works fine if I manually enter it and create
the array, only in VBA does it give the error. I'm using
XCL '02. How can I get around this error. I have lots
of these calculations to do for many dates.

Thx a bunch!

Kohai



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ActiveCell.FormulaArray code - Get error

Tom,

Thanks for your input, but I checked a formula that is
working (typed in, not done by VBA) and it's 264
characters, and it does work properly. I had this code
work last week in a similar wbk. Can't understand why it
won't work now.


-----Original Message-----
I believe a formulaArray formula is restricted to a

length of 255 characters
and yours appears to be longer than that.

--
Regards,
Tom Ogilvy

"Kohai" wrote in

message
...
Hi,

I have a formula I am running in a workbook to

calculate
the averages of a column based on values in another
column. I ran this same code on another workbook last
week without any problems, but this time I am getting

the
Run Rime Error -

1004 - Unable to Set the FormulaArray Property of the
Range Class

ActiveCell.FormulaArray = "=IF(ISERROR(AVERAGE(IF
([NUMEARNEST_30_60d_" & EDate & ".xls]30d_win!$B$4:$B"

& _
lRow & "=C10,[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow
& "))),0.000,AVERAGE(IF([NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$B$4:$B$" & lRow & "=C10,
[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow & ")))"

The formula works fine if I manually enter it and

create
the array, only in VBA does it give the error. I'm

using
XCL '02. How can I get around this error. I have lots
of these calculations to do for many dates.

Thx a bunch!

Kohai



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveCell.FormulaArray code - Get error

I didn't say an array formula, I said the formulaarray property. So yes,
you can type in an array formula that is greater than 255 characters, but
that is not what you asked about and isn't what you are having a problem
with. the formulaarray property will not accept an argument greater than
255 characters. Additionally, I believe the length restiction is based on
its length when expressed in the R1C1 format (although you don't have to
supply it in that format).

--
Regards,
Tom Ogilvy

"Kohai" wrote in message
...
Tom,

Thanks for your input, but I checked a formula that is
working (typed in, not done by VBA) and it's 264
characters, and it does work properly. I had this code
work last week in a similar wbk. Can't understand why it
won't work now.


-----Original Message-----
I believe a formulaArray formula is restricted to a

length of 255 characters
and yours appears to be longer than that.

--
Regards,
Tom Ogilvy

"Kohai" wrote in

message
...
Hi,

I have a formula I am running in a workbook to

calculate
the averages of a column based on values in another
column. I ran this same code on another workbook last
week without any problems, but this time I am getting

the
Run Rime Error -

1004 - Unable to Set the FormulaArray Property of the
Range Class

ActiveCell.FormulaArray = "=IF(ISERROR(AVERAGE(IF
([NUMEARNEST_30_60d_" & EDate & ".xls]30d_win!$B$4:$B"

& _
lRow & "=C10,[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow
& "))),0.000,AVERAGE(IF([NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$B$4:$B$" & lRow & "=C10,
[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow & ")))"

The formula works fine if I manually enter it and

create
the array, only in VBA does it give the error. I'm

using
XCL '02. How can I get around this error. I have lots
of these calculations to do for many dates.

Thx a bunch!

Kohai



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default ActiveCell.FormulaArray code - Get error

Sorry, I didn't follow your first reply. I'll have to
check what worked last time and see if it was < 255
char. (Prob was!) Thanks!
-----Original Message-----
I didn't say an array formula, I said the formulaarray

property. So yes,
you can type in an array formula that is greater than

255 characters, but
that is not what you asked about and isn't what you are

having a problem
with. the formulaarray property will not accept an

argument greater than
255 characters. Additionally, I believe the length

restiction is based on
its length when expressed in the R1C1 format (although

you don't have to
supply it in that format).

--
Regards,
Tom Ogilvy

"Kohai" wrote in

message
...
Tom,

Thanks for your input, but I checked a formula that is
working (typed in, not done by VBA) and it's 264
characters, and it does work properly. I had this code
work last week in a similar wbk. Can't understand why

it
won't work now.


-----Original Message-----
I believe a formulaArray formula is restricted to a

length of 255 characters
and yours appears to be longer than that.

--
Regards,
Tom Ogilvy

"Kohai" wrote in

message
...
Hi,

I have a formula I am running in a workbook to

calculate
the averages of a column based on values in another
column. I ran this same code on another workbook

last
week without any problems, but this time I am

getting
the
Run Rime Error -

1004 - Unable to Set the FormulaArray Property of

the
Range Class

ActiveCell.FormulaArray = "=IF(ISERROR(AVERAGE(IF
([NUMEARNEST_30_60d_" & EDate & ".xls]30d_win!

$B$4:$B"
& _
lRow & "=C10,[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow
& "))),0.000,AVERAGE(IF([NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$B$4:$B$" & lRow & "=C10,
[NUMEARNEST_30_60d_" & _
EDate & ".xls]30d_win!$R$4:$R$" & lRow & ")))"

The formula works fine if I manually enter it and

create
the array, only in VBA does it give the error. I'm

using
XCL '02. How can I get around this error. I have

lots
of these calculations to do for many dates.

Thx a bunch!

Kohai


.



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
FormulaArray..... HELP !!! Pierre[_6_] Excel Programming 4 May 5th 04 09:37 PM
How to avoid error 2015 when using ActiveCell.Offsett in own function Torben Laursen Excel Programming 2 February 18th 04 03:53 PM
code to change activecell neopolitan Excel Programming 2 October 2nd 03 09:05 PM
unable to set formulaarray of range class ERROR when using Conditional Sum John H.[_2_] Excel Programming 1 September 25th 03 09:55 PM


All times are GMT +1. The time now is 08:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"