none
I am looking to see if it is possible to filter multiple items in a Pivot Table in Excel with the function “contains”. RRS feed

  • Question

  • I am looking to see if it is possible to filter multiple items in a Pivot Table in Excel with the function “contains”.  Specifically I need to filter “contains one of” several items. I can’t do this manually because I need to filter so many items. Any help or idea would be greatly appreciated.

    Wednesday, May 2, 2012 9:22 PM

All replies

  • The contains will work if the field is row or column or page area.

    I hope you have prepared one set of code, kindly share the same so that we can help you much better.

    Sunday, May 6, 2012 10:14 AM
    Answerer
  • 5% of the time VBA can only do what you can do manually. However, try something like:
    For Each PvtItm In PvtTbl.PivotItems
      If PvtItm Like "*eve*" Or PvtItm Like "*ete*" _
            Or PvtItm Like "*Johnsson*" Then 
        PvtItm.Visible = True 
      Else 
        PvtItm.Visible = False
      End IF
    Next
    



    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Sunday, May 6, 2012 9:07 PM