0

I'm trying to filter a worksheet and here's what I have so far:

Worksheet("Sheet1").Range("A1:O1").AutoFilter Field:=12, 
    Criteria1:=Array("<34", "<>21", "<>22"),
    Operator:=xlAnd

Field[12] in the resulting rows must be:

  • Less than 34
  • Not 21 or 22

The problem is that <>22 seems to be overriding <34 and <>21. So is it possible to have the filter honor all of my criteria?

4

1 回答 1

1

也许:

Sub Macro1()
    ActiveSheet.Range("$A$1:$A$58").AutoFilter Field:=1, Criteria1:=Array("0", _
        "1", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2", "20", "23", "24", "25", _
        "26", "27", "28", "29", "3", "30", "31", "32", "33", "4", "5", "6", "7", "8", "9"), Operator _
        :=xlFilterValues
End Sub
于 2013-11-08T19:56:39.023 回答