I have an array formula in VBA:
when this outputs in the corresponding cell instead of 1 it comes out as x in the formula which is resulting in a name error. I think this is because the x is in quotes but is there a way to work around this?
Code:
For x = 1 To MatChgNum + 1
Cells(13 * x + 3, 2).Select
Selection.FormulaArray = _
"=INDEX(DB!R6C1:R500C1,SMALL(IF(DB!R6C2:R500C2=""m"",ROW(DB!R6C2:R500C2),""""),[B]x[/B])-ROW(DB!R6C2:R500C2)+1)"
when this outputs in the corresponding cell instead of 1 it comes out as x in the formula which is resulting in a name error. I think this is because the x is in quotes but is there a way to work around this?