Link to home
Start Free TrialLog in
Avatar of ali_
ali_Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Multiple Criteria Selection with VBA on an Autofilter

I'm sure for anyone with some VBA experience this will be easy as, but for me who has no clue I don't know where to start.

I have a macro pulling data from one sheet with an autofilter on and pasting the data on another:

Range("V3").Select
    ActiveSheet.Range("$A$1:$AG$999").AutoFilter Field:=28, Criteria1:= _
        "Service"
    Range("A1:AG999").Select
    Range("V3").Activate
    Selection.Copy
    Sheets("Email Data").Select
    ActiveSheet.Paste


All i want to do is simply enter another option e.g.

    ActiveSheet.Range("$A$1:$AG$999").AutoFilter Field:=28, Criteria1:= _
        "Service" or "MOT" or "Service And MOT"

but as you will probably notice I have no idea of how to do this. How exactly should i type this into VBA please so it doesn't just pull the "service" data but also the "MOT" and the "Service and MOT"?
ASKER CERTIFIED SOLUTION
Avatar of StephenJR
StephenJR
Flag of United Kingdom of Great Britain and Northern Ireland 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
TO clarify, above will return any entry containing MOT or Service.
Avatar of ali_

ASKER

Spot on. Thanks