Je remercie ceux qui gèrent ce site
J'ai trouvé la solution sur d'autres sites et j'ai souhaité ajouter ce code pour en bénéficier
Private Sub UserForm_Initialize()
cod......................
...........................................................
tbl = "Table2"
OnRng = Range(tbl).value
For i = 1 To UBound(OnRng): OnRng(i, 2) = CDate(OnRng(i, 2)): Next i
Irow = Range(tbl).Columns.Count
ColVisu = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
ListBox1.ColumnCount = 12
Me.ComboBox1.List = Application.Transpose(Range(tbl).Offset(-1).Resize(1)) ' Ordre tri
End Sub
Private Sub ComboBox1_click()
Dim tbl()
colTri = Me.ComboBox1.ListIndex
tbl = Me.ListBox1.List
TriMultiCol tbl, LBound(tbl), UBound(tbl), colTri
Me.ListBox1.List = tbl
End Sub
Sub Tri(a, gauc, droi)
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 TriMultiCol(a(), gauc, droi, colTri)
Dim colD, colF, ref, g, d, c, temp
colD = LBound(a, 2): colF = UBound(a, 2)
ref = a((gauc + droi) \ 2, colTri)
g = gauc: d = droi
Do
Do While a(g, colTri) < ref: g = g + 1: Loop
Do While ref < a(d, colTri): d = d - 1: Loop
If g <= d Then
For c = colD To colF
temp = a(g, c): a(g, c) = a(d, c): a(d, c) = temp
Next
g = g + 1: d = d - 1
End If
Loop While g <= d
If g < droi Then TriMultiCol a, g, droi, colTri
If gauc < d Then TriMultiCol a, gauc, d, colTri
End Sub