Leila33

New Member
Joined
Jul 14, 2016
Messages
10
Hello,

I am trying to apply the following array formula to a range in Excel:

=IFERROR(INDEX(AllFiles!A$2:A$1000000,SMALL(IF(AllFiles!$C$2:$C$1000000=$A$2,ROW(AllFiles!A$2:A$1000000)-ROW(AllFiles!A$2)+1),ROWS(AllFiles!A$2:AllFiles!A2))),"")

using the following methods that I found online (I'm not fluent in VBA)...

Sub filldowntest()


ActiveSheet.Range("D2:G2").FormulaArray = "=IFERROR(INDEX(AllFiles!A$2:A$1000000,SMALL(IF(AllFiles!$C$2:$C$1000000=$A$2,ROW(AllFiles!A$2:A$1000000)-ROW(AllFiles!A$2)+1),ROWS(AllFiles!A$2:AllFiles!A2))),"")"

ActiveSheet.Range("D2:G10000").FillDown


End Sub



I keep getting the 1004 error, produced when FormulaArray uses more than 255 characters...yet my formula is within these characters. I even tried the Replace method but that didn't work either.

Anyone know how to solve this? :(

I also need the cells to show only the results, by the way, not the formula...Thank you very much.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Double up the quotes in the formula.
Rich (BB code):
Sub filldowntest()


    ActiveSheet.Range("D2:G2").FormulaArray = "=IFERROR(INDEX(AllFiles!A$2:A$1000000,SMALL(IF(AllFiles!$C$2:$C$1000000=$A$2,ROW(AllFiles!A$2:A$1000000)-ROW(AllFiles!A$2)+1),ROWS(AllFiles!A$2:AllFiles!A2))),"""")"

    ActiveSheet.Range("D2:G10000").FillDown


End Sub
 
Upvote 0
Thank you!

I am now running into the following problem though...I am getting the same result in all cells. In other words, the unlocked cells in the formula are not changing as the code drags them...:confused:
 
Upvote 0
Which references aren't changing?

Which should change?
 
Upvote 0
everything bold and underlined:

ActiveSheet.Range("D2:G2").FormulaArray = "=IFERROR(INDEX(AllFiles!A$2:A$1000000,SMALL(IF(AllFiles!$C$2:$C$1000000=$A$2,ROW(AllFiles!A$2:A$1000000)-ROW(AllFiles!A$2)+1),ROWS(AllFiles!A$2:AllFiles!A2))),"""")"

ActiveSheet.Range("D2:G10000").FillDown
 
Upvote 0

Forum statistics

Threads
1,214,615
Messages
6,120,538
Members
448,970
Latest member
kennimack

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