troubleshooting Question

Filtering VBA - Add Criteria

Avatar of pdvsa
pdvsaFlag for United States of America asked on
Microsoft ExcelMicrosoft Office
8 Comments1 Solution143 ViewsLast Modified:
Experts,

How can I add a criteria "Pending"  on line 23?  
I want to have 2 filters:  Issued and Pending

thank you


Sub Sort_LC()
'
' Sort_LC Macro
'

'
    Columns("A:AA").Select
    ActiveWorkbook.Worksheets("LC").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("LC").Sort.SortFields.Add Key:=Range("M2:M20225"), _
        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("LC").Sort.SortFields.Add Key:=Range("G2:G20225"), _
        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("LC").Sort.SortFields.Add Key:=Range("B2:B20225"), _
        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("LC").Sort
        .SetRange Range("A1:AA20225")
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        
    End With
    ActiveSheet.Range("$A$1:$AA$2150").AutoFilter Field:=1, Criteria1:= _
        "=Issued", Operator:=xlOr, Criteria2:="="
    Range("A1").Select
    Sheets("pivot").Select
    ActiveSheet.PivotTables("Pivot_Banks_With_LC").PivotSelect "Status", xlButton, _
        True
    ActiveSheet.PivotTables("Pivot_Banks_With_LC").PivotCache.Refresh
    Sheets("LC").Select
    Range("A1").Select
End Sub
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros