+ Reply to Thread
Results 1 to 6 of 6

PIVOT table autofilter based on data validation cell selection

  1. #1
    Registered User
    Join Date
    11-28-2008
    Location
    The Netherlands
    Posts
    14

    PIVOT table autofilter based on data validation cell selection

    Hi,

    I have a question about pivot tables

    I attached a simplified example, question:

    how can I link the value of the drop down box to the PIVOT table, so that the PIVOT tables shows the selection of the drop down box, without manually selecting it in the PIVOT table itself,

    Thanks in advance
    Attached Files Attached Files
    Last edited by fredstyler; 02-15-2011 at 11:06 AM. Reason: Attachment was not correct

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: PIVOT table autofilter based on data validation cell selection

    Using your example, right click on Sheet1 select View Code and paste below into resulting window.
    Thereafter alterations to B2 should update the Pivot accordingly.

    Note: when saving you must save in a macro enabled format and remember to enable Macros when re-opening going forward.

    If using XL2010 (unknown) consider using a Slicer.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-28-2008
    Location
    The Netherlands
    Posts
    14

    Re: PIVOT table autofilter based on data validation cell selection

    Thanks!

    I am not so familiar yet with VBA in Excel, but do you know how it looks like if you have several PIVOTS on sheet 2 and 3, but the selection of countries remains on sheet 1?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: PIVOT table autofilter based on data validation cell selection

    Yes, but you need to provide some more information ... are you update all Pivots on Sheets 2 & 3 ?

    The Change event will still reside on Sheet1 but obviously you need to iterate the Pivots on other sheets.

    Roughly speaking:

    Please Login or Register  to view this content.
    however, this does not account for multi page selections etc... which may or may not be a requirement.

    post a sample to demonstrate requirements as nec.

  5. #5
    Registered User
    Join Date
    11-28-2008
    Location
    The Netherlands
    Posts
    14

    Re: PIVOT table autofilter based on data validation cell selection

    Hi,

    The simplified version looks like this (attachment). There are more pivots on sheet2 (Pivots), but they all relate back to the country which is selected on the sheet1 (Country). The data comes from the same file, but is collected on the sheet called Data.

    Thanks for all your help
    Attached Files Attached Files

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: PIVOT table autofilter based on data validation cell selection

    I believe the code provided previously does what you requested, however, you obviously need to modify the Sheets Array to reflect your own set up - I used Sheet2 & Sheet3 as these were referred to in prior post.

    The code (provided previously and amended per above) should reside in Country Sheet Object in VBE (ie location of Data Validation cell)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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