Unable to set the FormulaArray property of the Range class Error

yoan6

New Member
Joined
Jul 1, 2014
Messages
27
I hope someone can help me with this. When I manually enter this array formula into a cell using Ctrl-Shift-Enter, everything works fine:

=IF(ISNA(INDEX(Log_WK!A:A;MATCH(SLA!B5;IF(VLOOKUP(E5; Correspondance!A2:B173; 2; FALSE)=Log_WK!C:C;Log_WK!D:D);0)));"";INDEX(Log_WK!A:A;MATCH(SLA!B5;IF(VLOOKUP(E5; Correspondance!A2:B173; 2; FALSE)=Log_WK!C:C;Log_WK!D:D);0)))


But, when I run this same event with code, the following code:

Selection.FormulaArray = "=IF(ISNA(INDEX(Log_WK!C[-5],MATCH(SLA!RC[-4],IF(VLOOKUP(RC[-1], Correspondance!RC[-5]:R[171]C[-4], 2, FALSE)=Log_WK!C[-3],Log_WK!C[-2]),0))),"""",INDEX(Log_WK!C[-5],MATCH(SLA!RC[-4],IF(VLOOKUP(RC[-1], Correspondance!RC[-5]:R[171]C[-4], 2, FALSE)=Log_WK!C[-3],Log_WK!C[-2]),0)))"

...DOES NOT WORK. I get an error msg: "Unable to set the FormulaArray property of the Range class"

I know that is due to the fact that I have more than 255 characters.

So could you help me to split this formula.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hello

Maybe you can use IFNA(...) instead of IF(ISNA( ... ))
provided you use Excel 2007 or later.
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,822
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top