0% found this document useful (0 votes)
20 views2 pages

Buro

This VBA code contains event macros that update a pivot table called 'TCDglobal9' on a worksheet when the worksheet is activated, the pivot table is updated, the selection is changed, or a cell is changed. It refreshes the pivot cache, clears all filters on a pivot field called 'code2', and sets the current page filter based on values from other cells.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Buro

This VBA code contains event macros that update a pivot table called 'TCDglobal9' on a worksheet when the worksheet is activated, the pivot table is updated, the selection is changed, or a cell is changed. It refreshes the pivot cache, clears all filters on a pivot field called 'code2', and sets the current page filter based on values from other cells.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Private Sub Worksheet_Activate()

Application.ScreenUpdating = False
ActiveSheet.PivotTables("TCDglobal9").PivotFields("code2"). _
ClearAllFilters
ActiveSheet.PivotTables("TCDglobal9").PivotFields("code2"). _
CurrentPage = Sheets("TCDglobal9").Range("A1").Value

End Sub

Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)


Application.ScreenUpdating = False

ActiveSheet.PivotTables("TCDglobal9").PivotCache.Refresh
ActiveSheet.PivotTables("TCDglobal9").PivotFields("code2").ClearAllFilters
ActiveSheet.PivotTables("TCDglobal9").PivotFields("code2").CurrentPage =
Sheets("TCDs").Range("H555").Value

Application.ScreenUpdating = True

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Application.ScreenUpdating = False

ActiveSheet.PivotTables("TCDglobal9").PivotCache.Refresh
ActiveSheet.PivotTables("TCDglobal9").PivotFields("code2").ClearAllFilters
ActiveSheet.PivotTables("TCDglobal9").PivotFields("code2").CurrentPage =
Sheets("TCDs").Range("H555").Value

Application.ScreenUpdating = True
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)


'Update by Extendoffice 20180702
Dim xPTable As PivotTable
Dim xPFile As PivotField
Dim xStr As String
On Error Resume Next
xPTable.Refresh
If Intersect(Target, Range("H613")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Set xPTable = Worksheets("TCDs").PivotTables("TCDglobal9")
Set xPFile = xPTable.PivotFields("code1")
xStr = Target.Text
xPFile.ClearAllFilters
xPFile.CurrentPage = xStr
ActiveSheet.PivotTables("TCDglobal9").PivotCache.Refresh
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'Update by Extendoffice 20180702
Dim xPTable As PivotTable
Dim xPFile As PivotField
Dim xStr As String

RafraichirTCDglobal9

On Error Resume Next


If Intersect(Target, Range("G613")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Set xPTable = Worksheets("TCDs").PivotTables("TCDglobal9")
Set xPFile = xPTable.PivotFields("code1")
xStr = Target.Text
xPFile.ClearAllFilters
xPFile.CurrentPage = xStr
Application.ScreenUpdating = True
End Sub

Sub RafraichirTCDglobal9()
Feuil18.Select
Feuil18.PivotTables("TCDglobal9").PivotCache.Refresh
End Sub

You might also like