これはあなたのために働くはずです:
これを標準モジュールに入れます(これは効率の低い方法です-すべてのフィールドをチェックするため):
Sub LinkPivotTables_ByFieldItemName_ToShowDetail(pt As PivotTable)
Dim wkb As Workbook
Set wkb = ThisWorkbook
Dim wks As Worksheet
Set wks = wkb.Sheets(1)
Dim PivotTableIndex As Integer
Dim PivotFieldIndex As Integer
Dim PivotItemIndex As Integer
Dim PivotFieldIndexName As String
Dim PivotItemIndexName As String
Dim BoolValue As Boolean
Application.ScreenUpdating = False
Application.EnableEvents = False
On Error Resume Next
For PivotFieldIndex = 1 To pt.PivotFields.Count
PivotFieldIndexName = pt.PivotFields(PivotFieldIndex).Name
For PivotItemsIndex = 1 To pt.PivotFields(PivotFieldIndex).PivotItems.Count
PivotItemIndexName = pt.PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).Name
BoolValue = pt.PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).ShowDetail
For PivotTableIndex = 1 To wks.PivotTables.Count
' This If statement will dramatically increase efficiency - because it takes a long long time to set the value but it doesn't take long to check it.
If wks.PivotTables(PivotTableIndex).PivotFields(PivotFieldIndexName).PivotItems(PivotItemIndexName).ShowDetail <> BoolValue Then
wks.PivotTables(PivotTableIndex).PivotFields(PivotFieldIndexName).PivotItems(PivotItemIndexName).ShowDetail = BoolValue
End If
Next PivotTableIndex
Next PivotItemsIndex
Next PivotFieldIndex
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
次に、ピボットテーブルの編集でこのマクロを自動的に実行するには、これをSheet1コードに配置する必要があります(サポートが必要な場合はお知らせください)。
Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Call LinkPivotTables_ByFieldItemName_ToShowDetail(Target)
End Sub
すべてのピボットテーブルがシート1にある場合に機能します。行の長さの制限について心配していなかったので、最初にワードパッドまたは別のテキストエディタにコピーして貼り付ける必要があるかもしれません(ワードラップに注意してください)。
編集/追加:
これは、特定のシートオブジェクトにコードを配置する方法です。

EDIT2 / ADDITION2-効率性の方法:
この方法は効率を劇的に向上させますが、同期するフィールドを具体的に指定する必要があります(すべてを同期するわけではありません)。
Sub LinkPivotTables_ByFieldItemName_ToShowDetail(pt As PivotTable) 'takes as argument - pt As PivotTable
Dim wkb As Workbook
Set wkb = ThisWorkbook
Dim wks As Worksheet
Set wks = wkb.Sheets(1)
Dim PivotTableIndex As Integer
Dim PivotItemIndex As Integer
Dim PivotFieldIndex As String
Dim BoolValue As Boolean
Dim ItemName As String
Application.ScreenUpdating = False
Application.EnableEvents = False
PivotFieldIndex = "Year"
On Error Resume Next
For PivotItemsIndex = 1 To pt.PivotFields(PivotFieldIndex).PivotItems.Count
BoolValue = pt.PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).ShowDetail
ItemName = pt.PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).Name
For PivotTableIndex = 1 To wks.PivotTables.Count
' This If statement will dramatically increase efficiency - because it takes a long long time to set the value but it doesn't take long to check it.
If wks.PivotTables(PivotTableIndex).PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).ShowDetail <> BoolValue Then
wks.PivotTables(PivotTableIndex).PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).ShowDetail = BoolValue
End If
Next PivotTableIndex
Next PivotItemsIndex
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
この行で、同期するフィールドを手動で指定する必要があります。
PivotFieldIndex = "Year"
同じループ方法を使用してピボットテーブルを同期する他のいくつかのソリューションをオンラインで見つけました。問題は、適切なサイズのピボットテーブルを取得すると、すべて同じ効率の問題が発生することです。これらは、Item.ShowDetail値を設定する前にチェックするIFステートメントを含めることで、この問題をある程度回避します(値を設定するのに、単にチェックするよりもかなり長い時間がかかるため)。幸運を。