Re,
Une nouvelle proposition.
Si une solution VBA était à privilégier !...
Cdlt.
Public Sub Create_PT()
Dim wb As Workbook, ws As Worksheet
Dim rngPT As Range, PTCache As PivotCache, PT As PivotTable
Application.ScreenUpdating = False
Set wb = ActiveWorkbook
Set ws = wb.Worksheets("TCD VBA")
Set rngPT = ws.ListObjects(1).Range
On Error Resume Next
ws.PivotTables(1).TableRange2.Clear
On Error GoTo 0
Set PTCache = wb.PivotCaches.Create(xlDatabase, rngPT)
Set PT = PTCache.CreatePivotTable(ws.Cells(2, 8), "TCD_1")
With PT
.ManualUpdate = True
.AddFields RowFields:=Array("Code article", "Libellé")
With .PivotFields("Qté sortie")
.Orientation = xlDataField
.Function = xlSum
.NumberFormat = "#,##0;[Red]-#,##0;"
.Caption = ChrW(931) & " Qté sortie "
End With
.RowAxisLayout xlTabularRow
.ShowDrillIndicators = False
With .PivotFields("Code article")
.Subtotals(1) = False
.AutoSort xlDescending, PT.DataFields(1).Name
End With
.TableStyle2 = "PivotStyleMedium1"
.ManualUpdate = False
End With
End Sub