Closed Thread
Results 1 to 2 of 2

VBA commands to filter pivot tables

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    New Hampshire, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    VBA commands to filter pivot tables

    I have a pivot table containg 65,000+ combinations of "tools" and corresponding "charts"

    For instance: Tool 1 may be associated with charts A, B, C, D, E

    The pivot table is useful because I can drag and drop the pivot fields, and show that chart A is associated with tools 1, 2, 3, 4, 5

    etc.

    The actual question:

    When I record a macro and select/deselect all items within a pivot field, the macro shows one line of code to manually show or hide EACH individual chart:
    Please Login or Register  to view this content.
    If I'm trying to use a macro to hide all the charts except for a few which are stored in an array (output from another macro - the selection of charts will vary, thus using VBA to filter based upon a variable and not doing it manually), then I have a macro with thousands of lines of code, and it becomes useless if my selection of charts changes, or the query of 65,000 combinations is updated.

    I can't seem to find an easy way to say something like:

    Within the PivotField "Chart", hide all (Visible = False) PivotItems except for these: [chart names in my array]

    I have been playing around with some loops and might be able to do it, but I also need to minimize how long it takes to macro to scan through 65,000 rows and examine each cell before determining whether or not to hide it. Is there a "PivotItem(All).Visible = False" or something that I am unaware of?

    I hope what I'm asking is somewhat clear... I need an easy way to only display a small portion of the 65,000 combinations in my table based upon a selection generated by another macro and stored in an array.

    Any advice? Thanks a bunch
    Last edited by ALN1991; 07-11-2013 at 10:14 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VBA commands to filter pivot tables

    When you joined the forum recently you agreed to abide by the Forum Rules, but in haste I fear you might not have actually read them. Please stop and take a moment to read them now. We all follow these rules for the benefit of all, as must you. Thanks.

    (link above in the menu bar)



    =============
    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

Closed 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