G
Guest
Hi
Not sure if this is possible, or if I have tackled this the right way so any
help greatly appreciated! I am (trying to) write a macro that will use
multiple constraints (in 1 column) in autofilter, this is so that I don't
have to use the advanced filter option. The result of the macro should return
rows that contain "19" or "20" or "act" or "regul" in the 3rd field, and hide
the rows that don't. My macro that is not working at the moment:
'
Sheets("Agr-Tra").Select
Selection.AutoFilter Field:=3, Criteria1:="=regul*", Operator:=xlOr
Selection.AutoFilter Field:=3, Criteria1:="=act*", Operator:=xlOr
Selection.AutoFilter Field:=3, Criteria1:="=19*", Operator:=xlOr
Selection.AutoFilter Field:=3, Criteria1:="=20*"
End Sub
This is returning 0 rows with the above criteria, which is incorrect as it
should be over 300 rows.
Much appreciated
Gus
Not sure if this is possible, or if I have tackled this the right way so any
help greatly appreciated! I am (trying to) write a macro that will use
multiple constraints (in 1 column) in autofilter, this is so that I don't
have to use the advanced filter option. The result of the macro should return
rows that contain "19" or "20" or "act" or "regul" in the 3rd field, and hide
the rows that don't. My macro that is not working at the moment:
'
Sheets("Agr-Tra").Select
Selection.AutoFilter Field:=3, Criteria1:="=regul*", Operator:=xlOr
Selection.AutoFilter Field:=3, Criteria1:="=act*", Operator:=xlOr
Selection.AutoFilter Field:=3, Criteria1:="=19*", Operator:=xlOr
Selection.AutoFilter Field:=3, Criteria1:="=20*"
End Sub
This is returning 0 rows with the above criteria, which is incorrect as it
should be over 300 rows.
Much appreciated
Gus