I am trying to create formulas based off a filtered list.
Here are two other ways I’ve tried to make it, but still no success. Both formulas are trying to create the same thing, but neither work. All the variables and dictionary are functioning, I just need to write the formula correctly.
For i = 60 To 60 + dict.Count - 1
For j = 2 To 21
If j <> 19 And j <> 20 Then
wb2025.Cells(i, j).Formula = "=SUMIFS(Z81:Z" & last_filter & ",R81:R" & last_filter & ",C" & i & ",D81:D" & last_filter & "," & Cells(i, 2).Address & ")/(6*12)"
wb2025.Cells(i, j).FormulaR1C1 = "=SUMIFS(R" & last_filter & "C[24],R" & last_filter & "C[17],RC" & ",R" & last_filter & "C[3],R" & i & "C2) / (6 * 12)"
End If
Next
Next
I have tried using .formulaR1C1 and .formula, but I am not sure which is the best method. Please send an answer if you have one.
New contributor
Billy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.