Reputation: 19
How would I change the following formula to an array in a macro?
Dim lr As Long
lr = Cells(Rows.Count, 1).End(x1Up).Row
.Range (BV2:BV & lr).FormulaR1C1 = "IFERROR(INDEX(RC[12]:RC[15],MATCH(FALSE,ISBLANK(RC[12]:RC[15]),0)),"")"
End With
Upvotes: 0
Views: 37
Reputation: 152450
x1up
xhould be xlup
with a lowercase L
not the number 1
..FormulaArray
in the first cell then drag down."
need to be doubled in the formula string.=
to start the stringDim lr As Long
lr = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("BV2").FormulaArray = "=IFERROR(INDEX(RC[12]:RC[15],MATCH(FALSE,ISBLANK(RC[12]:RC[15]),0)),"""")"
.Range("BV2").AutoFill .Range("BV2:Bv" & lr)
Upvotes: 3