|
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i%, n%, pn, pi
Dim pt As PivotTable
On Error Resume Next
Application.EnableEvents = False
Application.ScreenUpdating = False
Set pt = Target.PivotTable
pi = pt.PageFields("姓名").CurrentPage
n = 查询.PivotTables.Count
For i = 1 To n
查询.PivotTables(i).PageFields("姓名").CurrentPage = pi
Next i
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
帮我改一下,谢谢!!!
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim i%, n%, pn, pi
- Dim pt As PivotTable
- On Error Resume Next
- Application.EnableEvents = False
- Application.ScreenUpdating = False
- Set pt = Target.PivotTable
- pi = pt.PageFields("姓名").CurrentPage
- n = Sheets("查询").PivotTables.Count
- For i = 1 To n
- Sheets("查询").PivotTables(i).PageFields("姓名").CurrentPage = pi
- Next i
- Application.EnableEvents = True
- Application.ScreenUpdating = True
- End Sub
复制代码
|
|