+ Reply to Thread
Results 1 to 2 of 2

Limiting a pivot table slicer to one selection

  1. #1
    Registered User
    Join Date
    03-13-2014
    Location
    Miami
    MS-Off Ver
    Excel 2010
    Posts
    42

    Limiting a pivot table slicer to one selection

    Hi,

    Im trying to develop a macro that limits the selection on a pivot table slicer to only one item at a time (so that people can't pick more than one thing at once by selecting the ctrl or shift keys) currently what I have is the following:

    Sub OneItemSlicer(Slicername As String, Item As String)

    Dim slItem As SlicerItem

    With ActiveWorkbook.SlicerCaches(Slicername)
    .Sliceritems(Item).Selected = True
    For Each slItem In .VisibleSlicerItems
    If slItem.Name <> .Sliceritems(Item).Name Then
    slItem.Selected = False
    End If
    Next slItem
    End With
    End Sub

    This macro works, however, it requires an action button, and the button can only be used for one of the items in the slicer. therefore I would need to have a separate action button for every item in the slicer.

    Is there a way to program the slicer directly? that way the action button wont be needed?

    thanks everyone

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Limiting a pivot table slicer to one selection

    Would it be easier to swap over to an ActiveX contorl instead of a slicer? then use the ActiveX to control the slicer in the background?
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

+ 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. [SOLVED] Use slicer selections on one pivot table to filter another pivot table
    By porkandbeans in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2013, 12:30 AM
  2. Limiting Slicer multiple selection
    By Paul-NYS in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 12-17-2012, 02:58 PM
  3. Slicer Macro - unfilter another slicer on selection
    By chadheins in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2012, 10:41 AM
  4. Pivot Table (Slicer) Help
    By skate1991 in forum Excel General
    Replies: 0
    Last Post: 10-11-2012, 11:52 AM
  5. [SOLVED] Limiting a Slicer's data
    By JimDandy in forum Excel General
    Replies: 2
    Last Post: 04-27-2012, 04:59 PM

Tags for this Thread

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