notuserfriendly
Programmer
Hi I'm having problems with
this
Sometime it works and sometimes it doesn't and that's not that fine. When the error happens I get error 1004:
Autofilter Method of Range class failed. it gets stuck in
one of the selection fields.
Any ideas?
this
Code:
ThisWorkbook.ActiveSheet.EnableAutoFilter = True
If ThisWorkbook.Worksheets("Sheet4").AutoFilter Is Nothing Then
Rows("1:1").Select
Selection.AutoFilter
End If
Selection.AutoFilter Field:=1, Criteria1:="<>*XX*", Operator:=xlOr, Criteria2:="<>*DG*"
'A2 && A3 Nonblanks
Selection.AutoFilter Field:=2, Criteria1:="<>"
Selection.AutoFilter Field:=3, Criteria1:="<>"
Selection.AutoFilter Field:=4, Criteria1:="=P*", Operator:=xlOr, Criteria2:="=AB"
Selection.AutoFilter Field:=21, Criteria1:="Game"
Sometime it works and sometimes it doesn't and that's not that fine. When the error happens I get error 1004:
Autofilter Method of Range class failed. it gets stuck in
one of the selection fields.
Any ideas?