Hello,
I’m attempting to use the following lines to remove unwanted information in a range. It works well if the Sheet Name is selected at the time. If I don’t have the sheet selected, it fails to work.
I've been able to Set ranges with the Autofilter option and run from a differnt sheet tab but cannot get the Advance filter to work the same way.
Any ideas is appreciated.
I’m attempting to use the following lines to remove unwanted information in a range. It works well if the Sheet Name is selected at the time. If I don’t have the sheet selected, it fails to work.
I've been able to Set ranges with the Autofilter option and run from a differnt sheet tab but cannot get the Advance filter to work the same way.
Any ideas is appreciated.
Code:
Worksheets("Weekend_Details").Range("A1:H" & lastMWeend).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range("AB1:AG4"), Unique:=False
With Worksheets("Weekend_Details").Range("A1:H" & lastMWeend)
Set rngWk = .Offset(1).SpecialCells(xlCellTypeVisible)
rngWk.SpecialCells(12).EntireRow.Delete
End With