I have a macro that auto sorts one worksheet and copies the filtered data to another.
What I need is for when my macro asks for input on what department to filter I need it to look for the one they list plus another.
Example: There is a department called QA and QC. When they type in QC I need the macro to filter for QC & QA. I need this to work both ways.
Here is part of my code
Formula:
org = InputBox(Prompt:="Enter Organization Here. (Ops, QA, QC, HR, etc.)", _
Title:="ENTER ORGANIZATION", Default:="Enter Organization Here")
If org = Cancel Then
Exit Sub
End If
On Error GoTo Canceled
tBeg = InputBox(Prompt:="Enter First Raised Date of Range.(YYYY, MM, DD)", _
Title:="ENTER THE DATE", Default:="Year, Month, First day")
On Error GoTo Canceled
tEnd = InputBox(Prompt:="Enter End Raised Date Range. (YYYY, MM, DD)", _
Title:="ENTER THE DATE", Default:="Year, Month, Last day")
With Worksheets("xxxxx")
.AutoFilterMode = False
.Range("A5").AutoFilter Field:=5, Criteria1:="=" & org
.Range("A5").AutoFilter Field:=2, Criteria1:=">=" & tBeg, _
Operator:=xlAnd, Criteria2:="<=" & tEnd
Thanks for the help
Bookmarks