Link to home
Start Free TrialLog in
Avatar of Jimi Sherman
Jimi ShermanFlag for United States of America

asked on

How to make a macro auto-filter multiple criteria?

Hi, I need to make a macro with an auto-filter using multiple criteria in column A.
The multiple criteria are "S*" and "P*".
Thanks,
Jimi
Avatar of Flyster
Flyster
Flag of United States of America image

Try this macro:
Sub Filter()

    ActiveSheet.Range("A:A").AutoFilter Field:=1, Criteria1:="=P", _
        Operator:=xlOr, Criteria2:="=S"
        
End Sub

Open in new window

Flyster
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jimi Sherman

ASKER

Thanks
Jimi