Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error, Unable to set the formulaArray property of the range class

I've created the following formula:

=IFNA(LOOKUP(10^99,--MID(O2,MIN(IF((--ISNUMBER(--MID(O2,ROW($1:$25),1))=0)*ISNUMBER(--MID(O2,ROW($2:$26),1)),ROW($2:$26))),ROW($1:$25))),SUMPRODUCT(MID(0&RIGHT(N2,4),LARGE(INDEX(ISNUMBER(--MID(RIGHT(N2,4),ROW($1:$25),1))* ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10))

It looks at column "N" and bring through just the number string. If there is an N/A it will then do the same on column "O" which is ran as an array and it works fine.

Yet when I converted it to VBA code, I get the error mentioned in the title .

Range("L2").Select
    Selection.FormulaArray = _
        "=IFNA(LOOKUP(10^99,--MID(RC[3],MIN(IF((--ISNUMBER(--MID(RC[3],ROW(R1:R25),1))=0)*ISNUMBER(--MID(RC[3],ROW(R2:R26),1)),ROW(R2:R26))),ROW(R1:R25))),SUMPRODUCT(MID(0&RIGHT(RC[2],4),LARGE(INDEX(ISNUMBER(--MID(RIGHT(RC[2],4),ROW(R1:R25),1))* ROW(R1:R25),0),ROW(R1:R25))+1,1)*10^ROW(R1:R25)/10))"

What it going wrong?

like image 469
Phairplay Avatar asked May 07 '15 15:05

Phairplay


1 Answers

thank you Dick for pointing me in the right directions and Rory for correcting my error

http://www.mrexcel.com/forum/excel-questions/853889-long-array-visual-basic-applications-issue.html

like image 106
Phairplay Avatar answered Oct 04 '22 01:10

Phairplay