Private Sub CommandButton1_Click()
Dim P As Range, col%, a, b, i&, deb, h&, PC As Range
Application.ScreenUpdating = False
Set P = Range("B3:E" & [B65536].End(xlUp).Row) 'adapter éventuellement
col = 2 'n° de la colonne à trier (C)
a = Array(36, 20, 40) 'couleurs dans l'ordre
b = Array(xlDescending, xlAscending, xlAscending) 'ordre du tri
P.Columns(1).Insert xlToRight 'colonne auxiliaire
Set P = P.Offset(, -1).Resize(, P.Columns.Count + 1)
For i = 1 To P.Rows.Count
P(i, 1) = Application.Match(P(i, 2).Interior.ColorIndex, a, 0)
Next
P.Sort P(1), xlAscending, Header:=xlNo 'tri sur les couleurs
For i = 1 To UBound(a) + 1 'sur chaque zone de couleur
deb = Application.Match(i, P.Columns(1), 0)
If IsNumeric(deb) Then
h = Application.CountIf(P.Columns(1), i)
Set PC = P(deb, 1).Resize(h, P.Columns.Count)
PC.Sort PC(1, col + 1), b(i - 1), Header:=xlNo 'tri sur la colonne
End If
Next
P.Columns(1).Delete xlToLeft 'supprime la colonne auxiliaire
End Sub