+ Reply to Thread
Results 1 to 3 of 3

PIVOT TABLE: Hide All Fields (without specific criteria)

  1. #1
    Registered User
    Join Date
    08-14-2007
    Posts
    27

    PIVOT TABLE: Hide All Fields (without specific criteria)

    Small but important problem:

    I have a workbook that creates and manipulates pivot tables with various field settings. One of my fields is the "Queue" field- and I only display data in specific Queues. Therefore, the current code I have sets every Queue to false visibility. Then, another code sets only the Queue's I want to include to true visibility.

    The problem is, sometimes the data I pull from does not contain all of the Queues- so my macro will crash because it tries to set a Queue's visibility to false- when that Queue does not exist in the data.

    If there were some way of setting ALL the "Queue" fields to false visibility- without specificing each Queue- then the code would work no matter what. It would change all Queues to false, and then show the ones I want (The Queue's I need to be visible are always present in the data). Ideas anyone? Attached is the code.
    Attached Files Attached Files
    Last edited by VBA Noob; 10-31-2007 at 05:02 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    There must be at least one field available when you have a pivot table.

    Assuming that you will always have a "(blank)" field then you could do something like

    Please Login or Register  to view this content.
    This will hide all the fields except blank. You can then do your process that unhides some of the fields.

    You could then hide the blank field (assuming of course, that there was at least one field available).

    To make sure one of your required fields exist, you could do a count on your source data to make sure it is available.

    HTH

    rylo

  3. #3
    Registered User
    Join Date
    08-14-2007
    Posts
    27
    Thank you very much- I believe that is the solution I need.

+ 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