les donnees de Pivot Table
Bonjour tout le monde
Voici mon problème j'ai un pivot table dans Sheet1 et des données dans sheet2 j'ai besoin après des changements dans sheet2 de changer data source de mon pivot table afin qu'il prend en compte mes changements j'ai essayé ainsi mais ça me fait des erreurs:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Sub Change_Pivot_TableDataSource()
Dim oPT As PivotTable
Dim oPC As PivotCache
Dim ORange As Range
Set oPT = Sheets("sheet1").PivotTables("PivotTable1")
Set oPC = oPT.PivotCache
Set ORange = Sheets("sheet2").Range("A2:AB" & Sheets("shee").Range("C65536").End(xlUp).Row)
oPC.SourceData = "TD_Reporting_EU_Breakdown!" & Application.ConvertFormula(ORange.Address, xlA1, xlR1C1)
oPT.RefreshTable
If Not oPT Is Nothing Then Set oPT = Nothing
If Not oPC Is Nothing Then Set oPC = Nothing
End Sub |
merciiiiiiii d'avance