Pivot Table
These codes will help you
to manage and make some changes in pivot tables in a flash.
Hide Pivot Table Subtotals
If you want to hide all the subtotals, just run this code. First
of all, make sure to select a cell from your pivot table and then run this
macro.
Sub HideSubtotals()
Dim pt As PivotTable
Dim pf As PivotField
On Error Resume Next
Set pt = ActiveSheet.PivotTables(ActiveCell.PivotTable.name)
If pt Is Nothing Then
MsgBox "You must place your cursor inside of a
PivotTable."
Exit Sub
End If
For Each pf In pt.PivotFields
pf.Subtotals(1) = True
pf.Subtotals(1) = False
Next pf
End Sub
No comments:
Post a Comment