Sub PivotTableRemoveSubtotals()
Dim pt As PivotTable
Dim pf As PivotField
'ピボットテーブルの設定
Set pt = ThisWorkbook.Sheets("シート名").PivotTables("ピボットテーブル名")
'小計を非表示にしたいフィールドの設定
Set pf = pt.PivotFields("フィールド名")
'小計を非表示にする
pf.Subtotals(1) = False
'すべての小計オプションを非表示にする場合、次のように設定
Dim i As Integer
For i = 1 To 12
pf.Subtotals(i) = False
Next i
End Sub
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme