ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array error (https://www.excelbanter.com/excel-programming/333540-array-error.html)

Craig[_2_]

Array error
 
I have a problem with the following lines in my Macro:


Range("c2").Select
Selection.FormulaArray = _
"=SUM(IF(jobno,RC[-2],IF(Dept=$R$1C,IF(Sun=""Not"",IF(Status<""No
Charge"",Ratecard,0),0),0)))"

jobno, Dept, Sun, Status and Ratecard are range names (and are all of equal
length, so that is not my problem).

I get the following error message : Run-time error'1004' Unable to set the
FormulaArray property of the range class.

I am using Excel 2002 SP3.

Thanks in advance

Craig





Bob Phillips[_7_]

Array error
 
Try

Range("c2").Select
Selection.FormulaArray = _
"=SUM(IF(jobno,RC[-2],IF(Dept=R1C,IF(Sun=""Not"",IF(Status<""No
Charge"",Ratecard,0),0),0)))"

--
HTH

Bob Phillips

"Craig" wrote in message
...
I have a problem with the following lines in my Macro:


Range("c2").Select
Selection.FormulaArray = _
"=SUM(IF(jobno,RC[-2],IF(Dept=$R$1C,IF(Sun=""Not"",IF(Status<""No
Charge"",Ratecard,0),0),0)))"

jobno, Dept, Sun, Status and Ratecard are range names (and are all of

equal
length, so that is not my problem).

I get the following error message : Run-time error'1004' Unable to set the
FormulaArray property of the range class.

I am using Excel 2002 SP3.

Thanks in advance

Craig







Craig[_2_]

Array error
 
Thanks Bob.


"Bob Phillips" wrote in message
...
Try

Range("c2").Select
Selection.FormulaArray = _
"=SUM(IF(jobno,RC[-2],IF(Dept=R1C,IF(Sun=""Not"",IF(Status<""No
Charge"",Ratecard,0),0),0)))"

--
HTH

Bob Phillips

"Craig" wrote in message
...
I have a problem with the following lines in my Macro:


Range("c2").Select
Selection.FormulaArray = _

"=SUM(IF(jobno,RC[-2],IF(Dept=$R$1C,IF(Sun=""Not"",IF(Status<""No
Charge"",Ratecard,0),0),0)))"

jobno, Dept, Sun, Status and Ratecard are range names (and are all of

equal
length, so that is not my problem).

I get the following error message : Run-time error'1004' Unable to set
the
FormulaArray property of the range class.

I am using Excel 2002 SP3.

Thanks in advance

Craig










All times are GMT +1. The time now is 01:23 PM.

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