Justin6587
11-03-2017, 05:12 AM
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.
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.