在工作表标签“分析表”右键,选择“查看代码”
ThisWorkbook 加入以下代码,参考附件范例
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim sh2 As Worksheet
Set sh2 = Sheets(“sheet4”)
If Sh.Name = “Sheet1” Then sh2.PivotTables(“数据透视表1”).PivotCache.Refresh
End Sub