If possible, how can I consolidate the formula step down to one line? Right now, with each loop, the code adds three formulas.
Code: Select all
Sub Macro1()
Dim i As Long
For i = 1 To 12 Step 5
Cells(i + 1, 3).FormulaR1C1 = "=SUMIFS(C[14],C[12],R" & i & "C5,C[13],RC[-1])"
Cells(i + 2, 3).FormulaR1C1 = "=SUMIFS(C[14],C[12],R" & i & "C5,C[13],RC[-1])"
Cells(i + 3, 3).FormulaR1C1 = "=SUMIFS(C[14],C[12],R" & i & "C5,C[13],RC[-1])"
Next i
End Sub