Hello,
I'm trying to use the following code to evaluate an array formula across a range of cells:
Sub EvaluateTest()
ActiveSheet.Range("D2:G2").Value = Evaluate("=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
However, I keep getting the result from the 1st cell copied across the entire range. The desired result should be different for each cell as the row and column change.
When I insert the formula manually and copy it down Excel, it works. However, I have some code on the other sheet that must be run daily. Such code does not work/freezes when links are present on this sheet, since the links are literally updating every second it runs.
Thus, this is why I need evaluated results only. Does anyone know how to fix this?? Thanks in advance.
Ps: I'm not very fluent in VBA. Sorry for any inconvenience.
I'm trying to use the following code to evaluate an array formula across a range of cells:
Sub EvaluateTest()
ActiveSheet.Range("D2:G2").Value = Evaluate("=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
However, I keep getting the result from the 1st cell copied across the entire range. The desired result should be different for each cell as the row and column change.
When I insert the formula manually and copy it down Excel, it works. However, I have some code on the other sheet that must be run daily. Such code does not work/freezes when links are present on this sheet, since the links are literally updating every second it runs.
Thus, this is why I need evaluated results only. Does anyone know how to fix this?? Thanks in advance.
Ps: I'm not very fluent in VBA. Sorry for any inconvenience.