Dim err As Byte
Dim Coll As New Collection
Dim table() As String
Dim dl1 As Long ' dernière ligne
Dim Cell As Range
Dim £i As Integer
Dim £j As Integer
Dim £t As Variant
Dim £y As Integer
With Sheets("Feuil2")
dl1 = .Cells(.Rows.Count, 1).End(xlUp).Row
i = 0
ReDim table(1 To dl1, 1 To dl1)
On Error GoTo erreur
For Each Cell In .Range("a2:a" & dl1)
If IsDate(Cell) Then
Coll.Add Cell, CStr(Cell)
If err = False Then
i = i + 1
table(i, 1) = Cell
table(i, 2) = Year(Cell) & Month(cel) & Day(Cell)
End If
End If
err = False
Next Cell
On Error GoTo 0
End With
' trier la table par permutation
For £i = 1 To UBound(table, 2)
For £j = 1 To UBound(table, 2)
If table(£j, 2) > table(£i, 2) Then
For £y = 1 To 2
£t = table(£i, £y)
table(£i, £y) = table(£j, £y)
table(£j, £y) = £t
Next £y
End If
Next £j
Next £i
With Me.ComboBoxdebut
.Clear
For £i = 1 To UBound(table, 2)
If table(£i, 1) <> "" Then .AddItem table(£i, 1)
Next £i
End With
Exit Sub
erreur:
err = True
Resume Next
End Sub