Public Longlet
Sub ListOnglets()
'Lister les onglets avec dictionnaire
ReDim Longlet(ActiveWorkbook.Worksheets.Count - 1)
For I = 0 To UBound(Longlet)
Longlet(I) = ActiveWorkbook.Worksheets(I + 1).Name
Next I
Call Tri(Longlet, LBound(Longlet), UBound(Longlet)) ' voir module mod_tri
MesOnglets2 (Longlet)
End Sub
Sub Tri(a, gauc, droi) ' Quick sort
ref = a((gauc + droi) \ 2)
g = gauc: d = droi
Do
Do While a(g) < ref: g = g + 1: Loop
Do While ref < a(d): d = d - 1: Loop
If g <= d Then
temp = a(g): a(g) = a(d): a(d) = temp
g = g + 1: d = d - 1
End If
Loop While g <= d
If g < droi Then Call Tri(a, g, droi)
If gauc < d Then Call Tri(a, gauc, d)
End Sub
Sub MesOnglets2(Longlet)
x = UBound(Longlet)
With UMesOnglets
.ListeO.List() = Longlet
.Height = Application.Min(300, x * 13 + 40)
.ListeO.Height = .Height - 22
.Show
End With
End Sub