Dans le programme associé au Userform RechIntuit :
Juste derrière le programme Sub Userform_Initialize et avant le programme Sub EnTeteListBox, j'ai inséré le programme Sub tri ()
Sub tri()
'Stop
If Me.ListBox1.ListCount < 1 Then Exit Sub
col = 2
Dim a()
a = Me.ListBox1.List
nbcol = UBound(a, 2) - LBound(a, 2) + 1
Call TriCD(a(), UBound(a), col - 1, True, nbcol)
Me.ListBox1.List = a
End Sub
Dans le module 1, j'ai placé le programme TriCD
Sub TriCD(table(), xn, col, ordre, nbcol)
'Stop
ecart = xn ' tri shell
Do While ecart >= 1
ecart = ecart \ 2
inv = True
Do While inv
inv = False
For i = 0 To xn - ecart
j = i + ecart
If ordre Then
X = (table(i, col) > table(j, col))
Else
X = (table(i, col) < table(j, col))
End If
If X Then
inv = True
For C = 0 To nbcol - 1
temp = table(j, C): table(j, C) = table(i, C): table(i, C) = temp
Next
End If
Next
Loop
Loop
' Stop
End Sub
J'avais peut-être mal compris ce que tu voulais faire et notamment ceci :
Pourrais-tu me montrer comment incorporer ton code dans l'usf et comment le lier aux 2 textbox "date de début" et "date de fin" ?