P
Peterke
Hi,
i'm having a little problem with vba(again), and could use some help.
The following formula gives "error 1004"
It's just an "IF" formula, so why does it not work?
Please advice.
Regards,
Peter
Range("H14").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-3]=""Sheet1"",'Sheet1'!R[-11]C[-3],IF(RC[-3]=""Sheet2"",Sheet2!R[-1
1]C[-3],IF(RC[-3]=""Sheet3"",Sheet3!R[-11]C[-3],IF(RC[-3]=""Sheet4"",Sheet4!
R[-11]C[-3],IF(RC[-3]=""Sheet5"",Sheet5!R[-11]C[-3],IF(RC[-3]=""Sheet6"",She
et6!R[-11]C[-3],IF(RC[-3]=""Sheet7"",Sheet7!R[-11]C[-3],IF(RC[-3]=""Sheet8""
,Sheet8!R[-11]C[-3],IF(RC[-3]=""Sheet9"",Sheet9!R[-11]C[-3],IF(RC[-3]=""Shee
t10"",Sheet10!R[-11]C[-3],IF(RC[-3]=""Sheet11"",Sheet11!R[-11]C[-3],IF(RC[-3
]=""Sheet12"",Sheet12!R[-11]C[-3],""""))))))))))))"
Range("H15").Select
i'm having a little problem with vba(again), and could use some help.
The following formula gives "error 1004"
It's just an "IF" formula, so why does it not work?
Please advice.
Regards,
Peter
Range("H14").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-3]=""Sheet1"",'Sheet1'!R[-11]C[-3],IF(RC[-3]=""Sheet2"",Sheet2!R[-1
1]C[-3],IF(RC[-3]=""Sheet3"",Sheet3!R[-11]C[-3],IF(RC[-3]=""Sheet4"",Sheet4!
R[-11]C[-3],IF(RC[-3]=""Sheet5"",Sheet5!R[-11]C[-3],IF(RC[-3]=""Sheet6"",She
et6!R[-11]C[-3],IF(RC[-3]=""Sheet7"",Sheet7!R[-11]C[-3],IF(RC[-3]=""Sheet8""
,Sheet8!R[-11]C[-3],IF(RC[-3]=""Sheet9"",Sheet9!R[-11]C[-3],IF(RC[-3]=""Shee
t10"",Sheet10!R[-11]C[-3],IF(RC[-3]=""Sheet11"",Sheet11!R[-11]C[-3],IF(RC[-3
]=""Sheet12"",Sheet12!R[-11]C[-3],""""))))))))))))"
Range("H15").Select