I have created a macro that allows me to add the formatting back to a Pivot Chart, because every time a Pivot Chart is amended it looses its formatting.
Then I’ve copied the Macro code into the Worksheet PivotTableUpdate…. Which means every time the Pivot Chart is changed it runs the macro code, which adds the label… that’s great and it works perfectly…
The code is added to the sheet that stores the pivot table…. Unfortunately I have a numerous pivot tables in a single sheet, therefore the formatting will apply to every single pivot table in that sheet… I don’t want that to happen…
I just want selected pivot tables in the single sheet to run the code…
How can I do this?
Thanks in advance
Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
ActiveChart.SeriesCollection(1).ApplyDataLabels AutoText:=True, LegendKey:= _
False, ShowSeriesName:=False, ShowCategoryName:=False, ShowValue:=True, _
ShowPercentage:=False, ShowBubbleSize:=False
End Sub