I'm trying to build an advanced filter table in excel vba like in the picture below. In the last column I'm using the below array formula.
Worksheets("Contracts").Range("N13:N" & Worksheets("contracts").Range("M" & Rows.Count).End(xlUp).Row).FormulaArray = _
"=sum(if(invoice!$A$3:$A$2000=contracts!B13,invoice!$AA$3:$AL$2000))"
The issue I'm having is that it copies the formula to all cells in range without changing the cell from: contracts!B13. It stays the same. B13.
Where I'm wrong?
Thank you, Daniel