+ Reply to Thread
Results 1 to 4 of 4

VBA to connect two slicers from two different data/cache.

  1. #1
    Registered User
    Join Date
    12-01-2017
    Location
    New York, New York
    MS-Off Ver
    Excel 2013
    Posts
    18

    VBA to connect two slicers from two different data/cache.

    I have two different data set but I would like to have one slicer that controls both pivots. The slicer would of course control/filter the same field group.

    Is there a code to connect them or a method to do this?

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: VBA to connect two slicers from two different data/cache.

    If you have 2 pivots with the same pivot cache (therefore relating to the same set of data), and you have a slicer connected to one of the pivots, you can connect the slicer to the other pivot by selecting the slicer, then Slicer Tools -> Options -> Report Connections and place a check against the pivots to be controlled by that slicer.

  3. #3
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: VBA to connect two slicers from two different data/cache.

    If I understand what your asking, then thats not the way it is meant to work.

    As I understand it you have:
    • 2x data sets
    • 2x Pivots (1 per data set)
    • Want to use a slicer that can control both?

    If the above is correct this doesnt work as Excel has no way of ensuring that the field is in both data sets as they are unrelated/independent. Regardless of if you and I as human beings are smart enough to look at both and realize the 2 data sets share a relationship between fields...Excel is dumb and sees no such connection, it views them as 2 separate batches of data unrelated to each other.

    This leads to the concept of relational databases and relationships between tables/data sets. You could potentially use PowerPivot and data models to relate the data to each other and then work with it, however that could be like killing an ant with a machine gun.

    You could alternatively merge your data if both sets share the same fields onto another sheet and then base everything off of the consolidated data table.

    VBA or not, this is just how data works in Excel. You may be able to use VBA to consolidate the data or manipulate the data model but honestly, its just another layer of complexity that you are best off manually putting to the test before attempting to code it.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  4. #4
    Registered User
    Join Date
    12-01-2017
    Location
    New York, New York
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: VBA to connect two slicers from two different data/cache.

    I see. I will just have to consolidate the two data sets so they both share the same cache. Thank you!

+ 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. Replies: 2
    Last Post: 06-29-2017, 11:31 AM
  2. [SOLVED] How do i change SourceData for all pivots in workbook while disconnect/connect slicers?
    By andygxxxv in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 07-04-2016, 10:15 AM
  3. How to connect slicers from different source of data, VBA code
    By Na2000 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-17-2016, 08:40 PM
  4. [SOLVED] Disconnect Slicers, Change Pivot Table Source, Reconnect Slicers: a problem
    By Geoff. in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2015, 02:27 PM
  5. [SOLVED] Macro to update pivot tables and use the SAME cache instead of repeatedly recreating cache
    By Fowzee1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2015, 11:26 PM
  6. [SOLVED] Can Anyone Connect My Slicers In This Table
    By NewJerichoMan in forum Excel General
    Replies: 7
    Last Post: 04-26-2015, 11:10 PM
  7. Replies: 0
    Last Post: 11-12-2014, 08:39 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