+ Reply to Thread
Results 1 to 2 of 2

Set Pivot Table Values to a List

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

    Set Pivot Table Values to a List

    I developed this piece of code to set pivot table values in a "template." The pivot table computes labor efficiencies and has filters for projects, commodities and work centers. I have these recorded in an Excel table and I loop through the table to read the values for each. Then I call this program.

    For example, a Project list may contain Project 01,Project 02,Project03. Note that there are no spaces. The actual values are separated by commas. There are similar lists for commodities and work centers.

    Let's say that the Pivot Table is called PT_Efficiency and is on a sheet called Efficiency Template. The three different PivotFields are Project, Commodity and Work Center.

    There are 5 parameters:
    • sht - pointer to the sheet with the pivot table on it
    • PTName = pivot table name
    • PFName = pivot field name
    • piName = the comma separated list of values to select
    • NotValue = reverses the display (True checks off boxes instead of turning them on)

    Here is how you call it
    Please Login or Register  to view this content.
    And here is the actual code
    Please Login or Register  to view this content.
    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.

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

    Re: Set Pivot Table Values to a List

    I have since modified the code as indicated to take care of where people get sloppy on the list definitions and include spaces.

    Please Login or Register  to view this content.

+ 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. [SOLVED] Using VBA to update pivot table filter from multiple values in a list
    By tyler0320 in forum Excel General
    Replies: 7
    Last Post: 04-09-2018, 03:49 PM
  2. VBA select multiple values in a pivot table field based on a list
    By DD1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-18-2014, 08:28 PM
  3. Get list of values meeting 2 critieria from Pivot Table
    By JayRab in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2014, 12:25 PM
  4. How-to Copy and Paste Values from list into Pivot Table filter
    By MacroNerd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2013, 06:26 PM
  5. [SOLVED] Use A Custom List of Values To Filter Pivot Table
    By dollylectric in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-29-2013, 01:05 PM
  6. i cannot filter the values from drop down list from a pivot table report
    By mamun_08023 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-21-2012, 02:50 PM
  7. [SOLVED] How to eliminate xero values from pivot table and list top 10 only
    By Dinesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-18-2006, 11:50 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