Sub test()
Dim c As Long
With ActiveSheet
c = .Rows(1).Find("Status").Column
.AutoFilterMode = False
.Columns(c).AutoFilter Criteria1:=Array("<>RET", "<>LTD"), Operator:=xlFilterValues
.AutoFilter.Range.Offset(1, 0).EntireRowDelete
.AutoFilterMode = False
End With
End Sub
This code is meant to find the column headed by "Status", then delete all rows with Status NOT EQUAL to "RET" and "LTD."
I'm getting Run-time error '1004': AutoFilter Method of Range class failed on
.Columns(c).AutoFilter Criteria1:=Array("<>RET", "<>LTD"), Operator:=xlFilterValues
Appreciate any help.
Bookmarks