+ Reply to Thread
Results 1 to 3 of 3

VBA to expand & collapse multiple pivot tables at the same time

  1. #1
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    2

    VBA to expand & collapse multiple pivot tables at the same time

    Hi, I have some VBA (provided by OnErrorGoto0) that allows for expanding or collapsing multiple pivot tables of similar structure, controlling the expand/collapse from just one of the pivot tables. The code works great one pivot item at a time, but fails when attempting to Expand Entire Field or Collapse Entire Pivot Field. My novice attempts at adjusting the code to include the Expand/Collapse Entire Field options have failed... hoping someone can help. I've included the code below, and I'm running Excel 2010.

    I also have thread posted here:
    http://www.mrexcel.com/forum/excel-q...same-time.html

    Thanks in advance.
    -j
    Please Login or Register  to view this content.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: VBA to expand & collapse multiple pivot tables at the same time

    Hi jrg and welcome to the forum,

    I created some code about a year ago with 3 pivot tables that agreed with each other, based on a filter. See if this attached helps you.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: VBA to expand & collapse multiple pivot tables at the same time

    Thank you MarvinP! I'll see if I can adapt your code to my needs. I'll post the final solution I land on.

    I did manage to get it working by adjusting the original code, but it's unusably inefficient/slow (adjusted code, below). More to come.

    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. VBA IF statement tied to expand/collapse pivot items
    By Platinum3x in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2013, 11:41 AM
  2. Expand and Collapse Multiple OLAP Pivots in the same sheet.
    By aeropostale in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2012, 09:50 AM
  3. Expand & Collapse Pivot Tables in multiple worksheets
    By kaseyleigh in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 12-12-2012, 09:57 AM
  4. Collapse/Expand - Pivot table Fields - Need equivalent option in Excel VBA Pivot table
    By ragavendraph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2012, 03:00 PM
  5. macro to expand and collapse a pivot field failing.
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-01-2010, 02:30 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