Bonjour Paulo, bonjour le forum,
Ton fichier modifié en pièce jointe. J'ai ajouté ce code :
Sub TriCol()
Dim TMP0 As Variant
Dim TMP1 As Variant
Dim TMP2 As Variant
Dim TMP3 As Variant
Dim TMP4 As Variant
Dim TMP5 As Variant
Dim TMP6 As Variant
Dim TMP7 As Variant
Dim I As Integer
Dim J As Integer
With UserForm1.ListBox1
For I = 1 To .ListCount - 1
For J = 1 To .ListCount - 1
If CStr(.List(I, 5)) < CStr(.List(J, 5)) Then
TMP0 = .List(I, 0): .List(I, 0) = .List(J, 0): .List(J, 0) = TMP0
TMP1 = .List(I, 1): .List(I, 1) = .List(J, 1): .List(J, 1) = TMP1
TMP2 = .List(I, 2): .List(I, 2) = .List(J, 2): .List(J, 2) = TMP2
TMP3 = .List(I, 3): .List(I, 3) = .List(J, 3): .List(J, 3) = TMP3
TMP4 = .List(I, 4): .List(I, 4) = .List(J, 4): .List(J, 4) = TMP4
TMP5 = .List(I, 5): .List(I, 5) = .List(J, 5): .List(J, 5) = TMP5
TMP6 = .List(I, 6): .List(I, 6) = .List(J, 6): .List(J, 6) = TMP6
TMP7 = .List(I, 7): .List(I, 7) = .List(J, 7): .List(J, 7) = TMP7
End If
Next J
Next I
End With
End Sub
Et je lance la procédure TriCol à la fin de chaque procédure de CheckBox_Click et aussi de la TextBox4_Change. Je ne comprends pas pourquoi je suis obligé de convertir en texte pour que ça fonctionne :
If CStr(.List(I, 5)) < CStr(.List(J, 5)) Then
Sinon j'ai très souvent la seconde ligne non classée ?!...