I have a VBA formula, let's say
Range("B2:B" & Cells(Rows.Count, "A").End(xlUp).Row).FormulaArray = "=MATCH(RC[-1],Sheet1!C1,0)"
When I run the macro it enters this into each cell
=MATCH(A2,Sheet1!A:A,0)
I want the RC[-1] argument to return cell A2, A3, A4, etc. It's currently returning A2 for all rows. How do I do this?
I also tried ActiveCell.FormulaArray and a for loop but it's far too slow for the number of rows I have.
.FormulaArraywill treat it as if you highlighted the entire range and put the formula in the first cell then hit Ctrl-Shift-Enter which enters the same formula in all the cells.