1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Sub miseAJourTCD()
Dim plageDonnees As Range
Dim nomFichier As String
Dim TCDRefresh As String
Dim TCD As PivotTable
Dim i As Integer
nomFichier = ActiveWorkbook.Name
Set plageDonnees = Workbooks(nomFichier).Worksheets("Balance").Range("A5:AF" & ligneBalance)
For i = 1 To Worksheets.Count
For Each TCD In Worksheets(i).PivotTables
ActiveSheet.PivotTables(TCD).ChangePivotCache _
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=plageDonnees, Version:=xlPivotTableVersion14)
TCD.RefreshTable
Next
Next i
End Sub |
Partager