Sub test()
Dim Plg As Range, Nom_TCD
Set Plg = Feuil1.Range("A1").CurrentRegion
Nom_TCD = InputBox("Nom du TCD?", "TCD", "TCD_N" & Second(Time))
ActiveWorkbook.PivotCaches.Add(SourceType:=1, _
SourceData:=Plg).CreatePivotTable TableDestination:="", _
TableName:=CStr(Nom_TCD), DefaultVersion:=1
With ActiveSheet
.PivotTableWizard TableDestination:=.Cells(1, 1)
With .PivotTables(CStr(Nom_TCD))
With .PivotFields("Division")
.Orientation = xlRowField
.Position = 1
End With
With .PivotFields("Article")
.Orientation = xlDataField
.Position = 1
End With
With .PivotFields("Mag.")
.Orientation = xlRowField
.Position = 2
End With
End With
End With
End Sub