VBA Autofilter Using Multiple Criteria

后端 未结 1 1309
清酒与你
清酒与你 2020-12-11 08:19

All,

I am trying to filter on multiple criteria within VBA.

However I cannot find a simple way of doing this. The criteria I am selecting will always be con

相关标签:
1条回答
  • 2020-12-11 08:52

    You need Operator:=xlFilterValues.

    Selection.AutoFilter field:=10, Operator:=xlFilterValues, Criteria1:=Array("Fixtures & Fittings", "Furniture & Equipment", "Land & Buildings", "Motor Vehicles", "Plant & Machinery")
    

    If the criteria is constant, I would assume that the filter range is consistent as well. You may wish to move away from using Selection in the near future. See How to avoid using Select in Excel VBA.

    0 讨论(0)
提交回复
热议问题