Private Sub test()
CopyTdc Sheets("TDC"), "TDC", Sheets("Feuil1"), "toto", "Data!R1C5:R5C7"
End Sub
Public Sub CopyTdc(ShSource As Worksheet, Tdc As String, Cible As Worksheet, TdcCible As String, Plage As String)
For Each td In ShSource.PivotTables
If UCase(td.Name) = UCase(Tdc) Then
td.TableRange2.Copy Cible.Range("A1")
With Cible
.PivotTables(.PivotTables.Count).ChangePivotCache Cible.Parent.PivotCaches.PivotCaches. _
Create(SourceType:=xlDatabase, SourceData:=Plage, Version:=xlPivotTableVersion12)
.PivotTables(.PivotTables.Count).Name = TdcCible
End With
Exit For
End If
Next
End Sub