daveyc3000
07-06-2015, 10:20 AM
so my data starts on row 7 (headers row 6)....i first filter for "M" in column B then subtotal...the thing is..."M" isn't always on row 7 ...it could change rows daily
i googled this code, but it doesnt appear to work since what i filter for is always on D7...other days it could be D10
Sub Test()
Dim LR As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
Range("D" & LR + 1).Formula = "=SUBTOTAL(9,D7:D" & LR & ")"
End Sub
i googled this code, but it doesnt appear to work since what i filter for is always on D7...other days it could be D10
Sub Test()
Dim LR As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
Range("D" & LR + 1).Formula = "=SUBTOTAL(9,D7:D" & LR & ")"
End Sub