Sub Sequence()
Dim Dict, i, aKeys
Set Dict = CreateObject("scripting.dictionary")
Dict.comparemode = vbTextCompare
aa = Sheets("commandes").Range("A1").CurrentRegion.Columns(1).Value
For i = 2 To UBound(aa)
If Len(aa(i, 1)) > 0 Then Dict(aa(i, 1)) = vbEmpty 'records unique de "Nom/Enseigne/Raison sociale"
Next
With Sheets("blad1")
.Columns("A").ClearContents 'RAZ
If Dict.Count Then
aKeys = Dict.keys
.Range("A5").Resize(Dict.Count).Value = Application.Transpose(aKeys) 'coller ces valeurs (pas nécessaire)
With .PivotTables(1).PivotFields("Nom/Enseigne/Raison sociale") 'boucle les items
For i = UBound(aKeys) To 0 Step -1
.PivotItems(CStr(aKeys(i))).Position = 1
Next
End With
End If
End With
End Sub