Dear all,
I have nearly solved my puzzle and need one final piece to be solved. I have been playing and searching around for days, but withouth any luck. Hopefully one of you can help me.
I use the working formula below to get the first result for an Index formula:
=INDEX('[151109 TM05 - HR Planning (Total).xls]Succession Plans'!$E$2:$E$20000;SMALL(IF($A2='[151109 TM05 - HR Planning (Total).xls]Succession Plans'!$N$2:$N$20000;ROW('[151109 TM05 - HR Planning (Total).xls]Succession Plans'!$N$2:$N$20000)-ROW('[151109 TM05 - HR Planning (Total).xls]Succession Plans'!$N$2)+1);1))
When I use the formula in a macro, I try the following:
Range("BG2").Select
Selection.FormulaArray = _
"=INDEX('[" & cFileNametmb05 & "]SP'!$E$2:$E$20000,SMALL(IF($A2='[" & cFileNametmb05 & "]SP'!$N$2:$N$20000,ROW('[" & cFileNametmb05 & "]SP'!$N$2:$N$20000)-ROW('[" & cFileNametmb05 & "]SP'!$N$2)+1),1))"
Selection.AutoFill Destination:=Range("BG2:BG150000"), Type:=xlFillDefault
cFileNametmb05 is already declared earlier in the macro and works perfectly for other formulas. It thus, opens the cFileNametmb05 report (151109 TM05 - HR Planning (Total).xls), goes back to the target file, then selects cell BG2 and then gives me the famous 1004 error ("Unable to set the FormulaArray property of the Range class").
I honestly hope that one of you smart people can help me out Any help is appreciated
Bookmarks