+ Reply to Thread
Results 1 to 2 of 2

Select fields in slicer with macro

  1. #1
    Registered User
    Join Date
    04-10-2014
    Location
    Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    1

    Select fields in slicer with macro

    Dear Excel user,

    I have two slicers, say slicer 'F' that slices on fields 'x', 'y' and 'z' and slicer 'E' that slices on fields 'a', 'b', 'c'.
    I select these values by using a very simple macro. For instance to select z in slicer "F", I have the following code:

    With ActiveWorkbook.SlicerCaches("F")
    .SlicerItems("x").Selected = False
    .SlicerItems("y").Selected = False
    .SlicerItems("z").Selected = True
    End With

    However, I want the selected fields to have more flexibility than which is possibly by coding them in VBA. Ideally, I would want to write the selected fields in a cell in Excel (also if there are more of them!), then let the macro retrieve these fields and use them to apply to the slicer. So I write in a cell slice on X and Z, the macro picks this up and performs this operation.

    Is this possible?

    Thank you very much,

    Kind regards, Joël

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,067

    Re: Select fields in slicer with macro

    Hi Joel,

    I think you should be able to do this by naming variables form a list you create in a Column on the worksheet somewhere.

    Then you could write something like;

    Please Login or Register  to view this content.
    Remember you are unique, like everyone else

+ 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. How to auto select from a Slicer last or top item
    By xtrenge in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-07-2014, 06:22 PM
  2. Macro to select date range in slicer
    By handerson0603 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2013, 03:06 PM
  3. Replies: 0
    Last Post: 04-04-2013, 02:30 AM
  4. 'select all' option in slicer
    By Paul-NYS in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 12-24-2012, 09:23 AM
  5. 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

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