+ Reply to Thread
Results 1 to 5 of 5

update pivot tables using named ranges

  1. #1
    Registered User
    Join Date
    12-07-2022
    Location
    Hoorn
    MS-Off Ver
    2210 excel
    Posts
    22

    update pivot tables using named ranges

    Hi All,

    I've been playing a lot lately with the pivot tables. I'm building a dashboard atm using a combination of datasets, supported by VBA.
    What I would like to accomplish is already quite clear but I have not been able to build it myself as my VBA skills only go so far.

    I intend the following (and i included a dummy workbook to illustrate the context)

    What I would like to be able to do is to type a component into "dashboard F3".
    This returns to me a list of product IDs from "compositions column A:A", that match the component of interest.

    This list of IDs is then stored as a named range

    The named range is then plotted into the product filter of the pivot table.

    Consequently, the pivot table returns to me the number of sold products over time that use the component of interest in its composition.

    (shortcuts or alternative solutions are welcome as well )

    Best
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: update pivot tables using named ranges

    I added a couple of helper pivot tables on the Compositions Sheet.

    The one in column F just gets a list of unique components for the sake of data validation. I overlaid this with a named dynamic range Component_List =OFFSET(Compositions!$H$4,0,0,COUNTA(Compositions!$H:$H)-2,1)

    I use this to validate cell F3 on the dashboard.

    Then I wrote a change event to set the filter on the other dashboard when cell f3 is changed.

    Please Login or Register  to view this content.
    The results are overlaid with another dynamic range: ID_List =OFFSET(Compositions!$H$4,0,0,COUNTA(Compositions!$H:$H)-2,1)

    The formula in cell F4 on the dashboard is simply =ID_List
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    12-07-2022
    Location
    Hoorn
    MS-Off Ver
    2210 excel
    Posts
    22

    Re: update pivot tables using named ranges

    Thanks!

    For the final step, can ID_List also be plotted into the filter on C3? Thereby returning the relevant sales data?

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: update pivot tables using named ranges

    It took a bit of juggling. I added a helper column to the sales data to see if the ids were on the list for the components. I then used that data as the filter for the pivot table on the dashboard sheet. But first I had to do a check to see if there were any matches. That's in cell I3. If there is a match, then I refresh the pivot table. If there isn't I pop up a message stating that there are no sales for the component.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-07-2022
    Location
    Hoorn
    MS-Off Ver
    2210 excel
    Posts
    22

    Re: update pivot tables using named ranges

    Wow thanks! this is perfect

    I appreciate the effort

+ 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. Listing All Named Ranges/Tables in Worksheet
    By Statto in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-20-2019, 05:37 PM
  2. Replies: 0
    Last Post: 10-15-2012, 07:24 AM
  3. Search all pivot tables in Workbook and update ranges
    By lampoonsaat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2012, 01:16 PM
  4. Is there a way to batch update named ranges?
    By qaliq in forum Excel General
    Replies: 6
    Last Post: 08-15-2012, 09:47 AM
  5. Tables & Named Ranges
    By ed ayers315 in forum Excel General
    Replies: 0
    Last Post: 04-10-2010, 03:16 PM
  6. Pivot tables & dynamic named ranges
    By WillysK5 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-05-2008, 04:32 PM
  7. Update Named Ranges
    By Raul in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-09-2005, 01:20 PM

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