+ Reply to Thread
Results 1 to 4 of 4

Show Multiple Items Selected in Pivot Filter

Hybrid View

cp41 Show Multiple Items Selected... 11-01-2013, 11:40 AM
cp41 Re: Show Multiple Items... 11-01-2013, 11:41 AM
cp41 Re: Show Multiple Items... 11-01-2013, 11:43 AM
Peter Cole Re: Show Multiple Items... 05-28-2014, 06:20 AM
  1. #1
    Registered User
    Join Date
    09-25-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    61

    Show Multiple Items Selected in Pivot Filter

    Hello all,

    I have a pivot table that is filtered based on the cell value of another cell, which contains a dropdown list. I also have the code to select multiple items from this data validation drop down list, and display them separated by commas. What I am looking to do is a multiple selection of the filter on the pivot table when i have multiple selections in the drop down. There is a disconnect between the cell value of the drop down with multiple selections and the pivot table filter itself when I do this.

    Can anyone say if this is possible or not? Or offer a different way to go about this?

    Thanks a bunch!

  2. #2
    Registered User
    Join Date
    09-25-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Show Multiple Items Selected in Pivot Filter

    Here is my code for the pivot table update currently

    Private Sub Worksheet_Change(ByVal Target As Range)
    
        If Intersect(Target, Range("B1:B4")) Is Nothing Then Exit Sub
            Dim pt As PivotTable
            Dim Field As PivotField
            Dim NewCat As String
            Dim ptv As PivotTable
            Dim field2 As PivotField
            Dim newcat2 As String
            Dim ptv2 As PivotTable
            Dim field3 As PivotField
            Dim newcat3 As String
            Dim ptv3 As PivotTable
            Dim field4 As PivotField
            Dim newcat4 As String
            
    
            Set pt = Worksheets("Pivot_Nov").PivotTables("PivotMPS")
            Set Field = pt.PivotFields("SIOP Model")
            NewCat = Worksheets("Results").Range("B4").Value
            Set ptv = Worksheets("Pivot_Nov").PivotTables("PivotMPS")
            Set field2 = ptv.PivotFields("SIOP Platform")
            newcat2 = Worksheets("Results").Range("B3").Value
            Set ptv2 = Worksheets("Pivot_Nov").PivotTables("PivotMPS")
            Set field3 = ptv2.PivotFields("Group")
            newcat3 = Worksheets("Results").Range("B2").Value
            Set ptv3 = Worksheets("Pivot_Nov").PivotTables("PivotMPS")
            Set field4 = ptv3.PivotFields("A&T Product Line")
            newcat4 = Worksheets("Results").Range("B1").Value
    
            With pt
                Field.CurrentPage = NewCat
            End With
            With ptv
                field2.CurrentPage = newcat2
            End With
            With ptv2
                field3.CurrentPage = newcat3
            End With
            With ptv3
                field4.CurrentPage = newcat4
            End With
                
        
    End Sub

  3. #3
    Registered User
    Join Date
    09-25-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Show Multiple Items Selected in Pivot Filter

    and here is the code I found to select multiple items from a dropdown:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rngDV As Range
    Dim oldVal As String
    Dim newVal As String
    If Target.Count > 1 Then GoTo exitHandler
    
    On Error Resume Next
    Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
    On Error GoTo exitHandler
    
    If rngDV Is Nothing Then GoTo exitHandler
    
    If Intersect(Target, rngDV) Is Nothing Then
       
    Else
      Application.EnableEvents = False
      newVal = Target.Value
      Application.Undo
      oldVal = Target.Value
      Target.Value = newVal
      If Target.Column = 3 Then
        If oldVal = "" Then
          
          Else
          If newVal = "" Then
          
          Else
          Target.Value = oldVal _
            & ", " & newVal
          End If
        End If
      End If
    End If
    
    exitHandler:
      Application.EnableEvents = True
    End Sub

  4. #4
    Registered User
    Join Date
    05-28-2014
    Posts
    1

    Re: Show Multiple Items Selected in Pivot Filter

    The easy way to show all entries in a multiple selection filter is:

    - create a CUBESET formula pointing to the datasource and the filter cell of the pivot table (=CUBESET(connection,reference of filter cell,caption)
    - with CUBESETCOUNT you can count the number of members in the selection
    - with CUBERANKEDMEMBER you can pick an entry from the set
    - by creating CUBERANKEDMEMBER formulas with an incrementing RANK value, all entries can be shown.
    - when RANK is greater than the number of entries in the selection, NA is shown. This can be solved with IFERROR

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pivot Report Filter - Readout/Display selected items in a cell
    By FixandFoxi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2012, 10:19 AM
  2. Multiple items on pivot page field to show on other pivot
    By o4008 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-16-2012, 09:11 AM
  3. Change Pivot table Filter Based on Cell Value *Multiple Filter items* Possible?
    By Flydd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2012, 06:57 AM
  4. Pivot table filter data field to show items with count more than n
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-22-2010, 07:36 PM
  5. [SOLVED] Print Pivottable - show all selected items in page filter
    By Koen in forum Excel General
    Replies: 0
    Last Post: 06-19-2006, 04:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1