I have a large workbook with a pivot table on every worksheet. The pivot tables are very similar to each other, and for the most part use the same fields, they just have different data selected.
The problem: I have to go through the entire thing and add fill color to certain fields, in order to make all the pivot tables easier to read. The fill color has to be consistent across the workbook.
I really don't want to do this manually. Is there some way that I can just do the fill color in one pivot table, and then create some code that loops through the workbook and applies that same fill color formatting to all the other pivot tables?
I tried to record a macro of myself adding fill color in one case, but the code that came back includes data that I did not mean to record (despite using relative references):
All I wanted to do was to format the row with the row label "sold to customer" as .TintAndShade = 0.599993896298105. But somehow the name of the pivot table (PivotTable12) and the value selected for the report filter (Jones) ended up in the code, and I'm not sure how to get them out of there, because they don't apply to all the other pivot tables that I want to format.
Thanks!
The problem: I have to go through the entire thing and add fill color to certain fields, in order to make all the pivot tables easier to read. The fill color has to be consistent across the workbook.
I really don't want to do this manually. Is there some way that I can just do the fill color in one pivot table, and then create some code that loops through the workbook and applies that same fill color formatting to all the other pivot tables?
I tried to record a macro of myself adding fill color in one case, but the code that came back includes data that I did not mean to record (despite using relative references):
Code:
PivotFormat()
'
'PivotFormat
'
ActiveSheet.PivotTables("PivotTable12").PivotSelect _
"'Sold To Customer'[All;Total] Jones", xlDataAndLabel, True
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent5
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
End Sub
All I wanted to do was to format the row with the row label "sold to customer" as .TintAndShade = 0.599993896298105. But somehow the name of the pivot table (PivotTable12) and the value selected for the report filter (Jones) ended up in the code, and I'm not sure how to get them out of there, because they don't apply to all the other pivot tables that I want to format.
Thanks!