Last active
March 26, 2018 17:16
-
-
Save ateneva/ba039dd0938c0962f28de696cdcc4dee to your computer and use it in GitHub Desktop.
Reset PivotTable Default Settings
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 ResetPTDefaultSettings() | |
Dim Wks As Worksheet | |
Dim PT As PivotTable | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'written by Angelina Teneva, 17/09/2016 | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
For Each Wks In ActiveWorkbook.Worksheets | |
If Wks.name <> "2013" Then Wks.Activate | |
For Each PT In ActiveSheet.PivotTables | |
PT.RowAxisLayout xlCompactRow | |
'PT.RowAxisLayout xlOutlineRow | |
'PT.RowAxisLayout xlTabularRow | |
'PivotTable Options --> Layout & Format tab | |
PT.HasAutoFormat = False 'turns off columns' autofit on update | |
PT.DisplayErrorString = True 'shows errors as empty cells | |
PT.ErrorString = "-" 'displays a value for the error string | |
PT.DisplayNullString = True 'displays zeros as empty cells | |
'PivotTableOptions --> Totals & Filters tab | |
PT.ColumnGrand = True 'shows grand totals for columns | |
PT.RowGrand = True 'shows grand totals for rows | |
PT.AllowMultipleFilters = True 'allows multiple filters to be set on pivot fields | |
'Pivot Table Options --> Data tab | |
PT.EnableDrilldown = False 'prevents access to raw data on double click | |
PT.PivotCache.MissingItemsLimit = xlMissingItemsNone 'removing non-existing items from filters | |
Next PT | |
Next Wks | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment