Could someone help me please?
Initially I had coded a filter to remove 1 criteria as below:
Filter = WorksheetFunction.Match("Class Name", Rows("9:9"), 0)
ActiveSheet.Range("A9:R6000").AutoFilter field:=Filter, Criteria1:="<>Deposits"
However I need it to exclude multiple items now... 13 Criteria to be exact.
So I tried the below code:
Filter = WorksheetFunction.Match("Class Name", Rows("9:9"), 0)
ActiveSheet.Range("A9:R6000").AutoFilter field:=Filter, Criteria1:="<>Deposits", _
Operator:=xlAnd, Criteria2:="<>Cash", _
Operator:=xlAnd, Criteria3:="<>Commodities", _
Operator:=xlAnd, Criteria4:="<>Metals", _
Operator:=xlAnd, Criteria5:="<>Stock", _
Operator:=xlAnd, Criteria6:="<>Bonds", _
Operator:=xlAnd, Criteria7:="<>Corporate", _
Operator:=xlAnd, Criteria8:="<>Placements", _
Operator:=xlAnd, Criteria9:="<>Securities", _
Operator:=xlAnd, Criteria10:="<>HBonds", _
Operator:=xlAnd, Criteria11:="<>Rights", _
Operator:=xlAnd, Criteria12:="<>Investments", _
Operator:=xlAnd, Criteria13:="<>Bills"
But I an now getting a Run-time error '1004'.
Can someone help me please? I've searched for Arrays etc but cant get a code to exclude all these criteria.
Initially I had coded a filter to remove 1 criteria as below:
Filter = WorksheetFunction.Match("Class Name", Rows("9:9"), 0)
ActiveSheet.Range("A9:R6000").AutoFilter field:=Filter, Criteria1:="<>Deposits"
However I need it to exclude multiple items now... 13 Criteria to be exact.
So I tried the below code:
Filter = WorksheetFunction.Match("Class Name", Rows("9:9"), 0)
ActiveSheet.Range("A9:R6000").AutoFilter field:=Filter, Criteria1:="<>Deposits", _
Operator:=xlAnd, Criteria2:="<>Cash", _
Operator:=xlAnd, Criteria3:="<>Commodities", _
Operator:=xlAnd, Criteria4:="<>Metals", _
Operator:=xlAnd, Criteria5:="<>Stock", _
Operator:=xlAnd, Criteria6:="<>Bonds", _
Operator:=xlAnd, Criteria7:="<>Corporate", _
Operator:=xlAnd, Criteria8:="<>Placements", _
Operator:=xlAnd, Criteria9:="<>Securities", _
Operator:=xlAnd, Criteria10:="<>HBonds", _
Operator:=xlAnd, Criteria11:="<>Rights", _
Operator:=xlAnd, Criteria12:="<>Investments", _
Operator:=xlAnd, Criteria13:="<>Bills"
But I an now getting a Run-time error '1004'.
Can someone help me please? I've searched for Arrays etc but cant get a code to exclude all these criteria.