Dear All,
I am trying to make and ranges formulas that are not hardcode. fLR is last row in column A.
Instead of using Range("B67:I67") I am trying make it dynamic using
Cells(fLR + 1, 2, Cells(fLR + 1, 9)) but not working. Formula should be
SUM(B50:B66).
How can I make formula and range more variable?
Biz
I am trying to make and ranges formulas that are not hardcode. fLR is last row in column A.
Instead of using Range("B67:I67") I am trying make it dynamic using
Cells(fLR + 1, 2, Cells(fLR + 1, 9)) but not working. Formula should be
SUM(B50:B66).
How can I make formula and range more variable?
Code:
Sub Test()
Dim fLR As Long
fLR = Cells(Rows.Count, "A").End(xlUp).Row
'With Range("B67:I67")before
'Apply Subtotals
With Cells(fLR + 1, 2, Cells(fLR + 1, 9))
.FormulaR1C1 = "=SUM(R[-17]C:R[-1]C)"
.Font.Bold = True
End Sub
End With
Biz