Consulting

Results 1 to 3 of 3

Thread: Hide Pivot items based on table

  1. #1

    Hide Pivot items based on table

    I have a pivot table that contains a list of employees that are available to travel to assist in other locations. I would like to have (on another sheet) a table that I can keep updated with the employees currently traveling and will hide them from the pivot table and queries that reference it.
    I have been able to get this working with set employee numbers

    ActiveSheet.PivotTables("PivotTable1").PivotFields( _
    "[Associates].[Employee Number].[Employee Number]").HiddenItemsList = Array( _
    "[Associates].[Employee Number].&[0]","[Associates].[Employee Number].&[34]")
    Where "0" and "34" would be the employee numbers to exclude. But how would I make the array reference a table and exclude all entries from there? Any help would be greatly appreciated.

    I have tried replacing the "0" with a reference to a (cell).Value but it didnt work. I am at a loss here.
    Last edited by SamT; 11-04-2017 at 07:39 AM.

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    The # Icon in the Post editor is for VBA Code. It will insert Code Formatting Tags around selected text or you can insert the Tags and paste your code between them.


    Consider this a Moderator bump.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,874
    Prepare us a little sample file with such a pivot, perhaps include what you've got working so far, so that we can test solutions out without spenidng time setting up your scenari while guessing (wrongly) the sorts and arrangement of data you have.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •