Hey all,
I find that I constantly have to manually change particular pivot table row label fields to tabular view format, then turn off subtotals for that field. I would like to save a considerable amount of time and make a macro combining these two actions. The fields will almost never have the same name or data, so I need to specify by the currently selected field. Here is the vba I've cobbled together off the net, to no avail:
Any help would be greatly appreciated. Thanks!
I find that I constantly have to manually change particular pivot table row label fields to tabular view format, then turn off subtotals for that field. I would like to save a considerable amount of time and make a macro combining these two actions. The fields will almost never have the same name or data, so I need to specify by the currently selected field. Here is the vba I've cobbled together off the net, to no avail:
Code:
With pt
.RowAxisLayout xlTabularRow
End With
Dim pt As PivotTable
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.RowFields
'Set index 1 (Automatic) to True,
'so all other values are set to False
pf.Subtotals(1) = True
Next pf
Next pt
End Sub
Any help would be greatly appreciated. Thanks!