Bonjour,
Une proposition.
Cdlt.
Private Sub ToggleButton1_Click()
Dim ws As Worksheet
Dim pt As PivotTable
Dim pf As PivotField
Application.ScreenUpdating = False
Set ws = ActiveSheet
With ws
Set pt = .PivotTables(1)
With pt
.ManualUpdate = True
If ToggleButton1 Then
ToggleButton1.Caption = "Trier du plus petit au plus grand"
.PivotFields("CUSTOMER NAME").AutoSort xlDescending, "Sum of Montant"
Else
ToggleButton1.Caption = "Trier du plus grand au plus petit"
.PivotFields("CUSTOMER NAME").AutoSort xlAscending, "Sum of Montant"
End If
.ManualUpdate = False
End With
End With
Set pt = Nothing: Set ws = Nothing
End Sub