Last active
April 21, 2018 14:52
-
-
Save ateneva/6f75fa3dea68defe7ea406567a2b9d85 to your computer and use it in GitHub Desktop.
Keep Pivot Field source name (followed by a blank)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub AddDefaultName() | |
Dim Wks As Worksheet | |
Dim PT As PivotTable | |
Dim PF As PivotField | |
Dim Title As String | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'written by Angelina Teneva, September 2016 | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
For Each Wks In ActiveWorkbook.Worksheets | |
For Each PT In Wks.PivotTables | |
On Error Resume Next | |
For Each PF In PT.DataFields | |
Title = PF.SourceName & " " | |
PF.Caption = Title | |
Next PF | |
Next PT | |
Next Wks | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment