+ Reply to Thread
Results 1 to 4 of 4

VBA to select filter from pivot tables

  1. #1
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    316

    VBA to select filter from pivot tables

    Dear Excel Forum

    I have been using the below code to change the filter on my pivot tables based on the value in another cell and all works fine. However i set up my pivots slightly different in my current file, as i need to see unique values only i have created the pivot table and selected "Add this data to the data model". Using the same code below does not seem to be working on this pivot and i wondered if someone would be able to offer some help.


    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: VBA to select filter from pivot tables

    Hi, without seeing the actual worksheet that you use, it is very difficult to determine where the error originates.
    My first guess would be that the number of the pivottable has changed.

    In order to help, please post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information.

    Cheers
    Erwin
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  3. #3
    Forum Contributor
    Join Date
    07-02-2013
    Location
    abbots langley
    MS-Off Ver
    Excel 2010
    Posts
    316

    Re: VBA to select filter from pivot tables

    Hi Eastw00d

    I have attached the file.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: VBA to select filter from pivot tables

    I have rebuild the pivottable as the one present in the workbook didn't work.
    Then of course you'll get another Pivottable-name, so effectively that's the only thing that I have changed in the macro and the Worksheet_Calculate sub did the rest.

    Cheers
    Erwin
    Attached Files Attached Files

+ 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: 1
    Last Post: 02-25-2018, 09:47 PM
  2. Two pivot tables with the filter of pivot table 2 to automatically update to filter 1
    By StefaniaLa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2018, 06:19 PM
  3. [SOLVED] Select Automatic Report Filter in Pivot where Filter exist in Data table else select Blank
    By vinaynaran in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2016, 08:47 AM
  4. One filter/ Master filter multiple pivot tables based on worksheet...
    By jlworden in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-10-2013, 11:16 AM
  5. Duplicate Report Filter and Row Labels Filter Across Multiple Pivot Tables
    By tash in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2013, 05:32 PM
  6. Filter several pivot tables by one programmed date range filter in Excel 2003
    By olewka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2011, 11:49 AM
  7. Replies: 3
    Last Post: 06-23-2009, 01:36 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