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 just wanted to confirm if this would handle my case:
Sub Test()
Dim LR As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
Range("D" & LR + 7).Formula = "=SUBTOTAL(9,D7:D" & LR & ")"
End Sub
i googled this code, but just wanted to confirm if this would handle my case:
Sub Test()
Dim LR As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
Range("D" & LR + 7).Formula = "=SUBTOTAL(9,D7:D" & LR & ")"
End Sub
Last edited: