Hi, I'm not sure what is wrong with the below code but somehow I'm unable to filter the options which I want to filter. Can anyone help?
VBA Code:
Sub AdvancedFilterExample()
'Define variables
Dim ws As Worksheet
Dim rng As Range
Dim criteria As String
'Set the worksheet you want to filter
Set ws = ThisWorkbook.Sheets("Sheet1")
'Set the range you want to filter
Set rng = ws.Range("A2:AY" & ws.Cells(ws.Rows.Count, "AY").End(xlUp).Row)
'Set the criteria for column AA
criteria = "*10309*" & "," & "*10313*" & "," & "*10316*"
'Set the criteria for column F
criteria1 = "*Hitrust*" & "," & "*#$DR*" & "," & "*#$HR*" & "," & "*#$OO*"
'Apply the advanced filter
rng.AdvancedFilter Action:=xlFilterInPlace, Criteria1:=Array(criteria, criteria1), Operator:=xlAnd
End Sub