Multiple Filtering in Excel VBA?

后端 未结 2 521
生来不讨喜
生来不讨喜 2021-01-13 00:20

I\'m trying to filter my data using 2 columns and 2 different filter requirements.

    ActiveSheet.AutoFilterMode = False
    ActiveSheet.Range(\"$K$2:$ZZ$20         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-13 00:59

    Almost. Managed to do this using an array. The Range does not need to be the same by the way.

         ActiveSheet.AutoFilterMode = False
        ActiveSheet.Range("$E$2:$ZZ$200").AutoFilter Field:=nice, Criteria1:="yes"
        ActiveSheet.Range("$E$2:$ZZ$200").AutoFilter Field:=1, Criteria1:=Array( _
        "Filter 1", ""Filter 2", "On "Filter 3", ""Filter 4", ""Filter 5"), Operator:=xlFilterValues
    

提交回复
热议问题