Pivot Table - Change / Format Legend Names
Excel 2007 PivotTable, PivotChart
Change the PT data headers instead:
Sub NameChange()
Dim s As String
Dim n As Integer
With ActiveSheet.PivotTables(1)
For n = 1 To .DataFields.Count
s = .DataFields(n).Name
s = Replace(s, "Sum of ", "_")
..DataFields(n).Name = s
Next n
End With
End Sub
|