Sub TriFeuilles()
Application.EnableEvents = False
Dim tabFeuille() As Variant
nb = Sheets.Count - 1
ReDim tabFeuille(1 To nb, 2)
i = 1
For Each ws In Sheets
If ws.Name <> "NOUVEAU MODELE" Then
tabFeuille(i, 1) = Split(ws.Name, " ")(0)
tabFeuille(i, 2) = Split(ws.Name, " ")(1)
i = i + 1
End If
Next ws
Tri tabFeuille(), LBound(tabFeuille, 1), UBound(tabFeuille, 1), 2, 1
LastFeuille = "NOUVEAU MODELE"
For i = LBound(tabFeuille, 1) To UBound(tabFeuille, 1)
Sheets("" & tabFeuille(i, 1) & " " & tabFeuille(i, 2) & "").Move after:=Sheets(LastFeuille)
LastFeuille = tabFeuille(i, 1) & " " & tabFeuille(i, 2)
Next i
Application.EnableEvents = True
End Sub
Sub Tri(a(), gauc, droi, Col1erTri, Col2ndTri) ' Quick sort
ref = a((gauc + droi) \ 2, Col1erTri) & a((gauc + droi) \ 2, Col2ndTri)
g = gauc: d = droi
Do
Do While a(g, Col1erTri) & a(g, Col2ndTri) < ref: g = g + 1: Loop
Do While ref < a(d, Col1erTri) & a(d, Col2ndTri): d = d - 1: Loop
If g <= d Then
For k = LBound(a, Col1erTri) To UBound(a, Col1erTri)
temp = a(g, k): a(g, k) = a(d, k): a(d, k) = temp
Next k
g = g + 1: d = d - 1
End If
Loop While g <= d
If g < droi Then Call Tri(a, g, droi, Col1erTri, Col2ndTri)
If gauc < d Then Call Tri(a, gauc, d, Col1erTri, Col2ndTri)
End Sub