Excel VBA - Privot table filter multiple criteria

前端 未结 3 1286
北海茫月
北海茫月 2021-01-12 23:28

I am trying to filter a pivot table with multiple criteria. I\'ve check other posts, but I am getting the error \"AutoFiler method of Range class failed\" when running:

3条回答
  •  孤街浪徒
    2021-01-13 00:09

    These issue has a very simple solution.

    Just use method to select items via “SLICER” (and VBA code).

    For more details use record macro option.

    Code example

    ActiveWorkbook.SlicerCaches("Slicer_RS_YM").SlicerItems(“Item1Name”).Selected = True ‘ include ActiveWorkbook.SlicerCaches("Slicer_RS_YM").SlicerItems(“Item2Name”).Selected = False ‘ exclude

提交回复
热议问题