Note - This was posted in the Excel forum with no response but I think this is more at home in this forum. Apologies for any rules broken
I have a pivot table that has names in the Row.
This PT is a source for a bar chart that needs to show each individual person in the bar chart (basically one bar).
I thought the best way to do this was to loop through the names and filter in the pivot table to show just the one person.
The code that is recorded doesn't want to work when I amend to use a string variable for the name
I am really struggling with this as it looks like it should be very simple but I can't find anything on the net to help.
TIA
I have a pivot table that has names in the Row.
This PT is a source for a bar chart that needs to show each individual person in the bar chart (basically one bar).
I thought the best way to do this was to loop through the names and filter in the pivot table to show just the one person.
The code that is recorded doesn't want to work when I amend to use a string variable for the name
VBA Code:
ptPivotTable.PivotFields("[My Accounts Region].[Proper Name].[Proper Name]").VisibleItemsList = Array("[My Accounts Region].[Proper Name].&[" & strPerson & "]")
TIA