PDA

View Full Version : so my data starts on row 7 (headers row 6)....i first filter for "M" in column B then



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

Paul_Hossler
07-08-2015, 07:59 AM
Maybe a small sample workbook would help

Can you attach one?

BTW, I'm a little confused:

"is always on D7...other days it could be D10"

"M" isn't always on row 7 ...it could change rows daily "