Hi all, I have a piece of code which works fine if you change the
in the macro which is not efficient as there are many filter ranges. I did comment the filter range out and just filter it manually on the spreadsheet but the formula does not get added to the cell, its fine when not filtered but as soon as it has a filter it doesnt work, thanks for the advice and help yesterday but it's still not right and I cant see whats wrong with it.
Sub Filter_Sum()
Set W1 = Worksheets("Master")
Set Lastrow = W1.Cells(Rows.Count, "I").End(xlUp).Offset(2, 0)
'With W1.Range("A1").CurrentRegion
' .AutoFilter
' .AutoFilter Field:=20, Criteria1:="340"
'End With
Lastrow.FormulaR1C1 = "=SUBTOTAL(109,R2C:R[-1]C)"
End Sub
Bookmarks