Option Explicit
Sub travdem()
Dim Cellule1 As Range, Plg1 As Range, Cellule2 As Range
Dim Nomfeuille1 As String, Col1 As String
Dim Dl2 As Long
'parametre
Nomfeuille1 = "Feuil1"
Col1 = "B"
Dl2 = 1
'code
With Worksheets("Feuil1")
For Each Cellule1 In .Range(Col1 & "2:" & Col1 & .Range(Col1 & .Rows.Count).End(xlUp).Row)
If Cellule1 <> "" Then
.Rows(Cellule1.Row).Copy Destination:=Worksheets("Feuil2").Range("A" & Dl2)
Dl2 = Dl2 + 1
Do
For Each Cellule2 In .Range(Col1 & Cellule1.Row + 1 & ":" & Col1 & .Range(Col1 & .Rows.Count).End(xlUp).Row)
If Cellule1 = Cellule2 Then
.Rows(Cellule2.Row).Copy Destination:=Worksheets("Feuil2").Range("A" & Dl2)
Dl2 = Dl2 + 1
Cellule2 = ""
End If
Next Cellule2
Exit Do
Loop
Cellule1 = ""
'Trier les données par date dans feuille 2
Worksheets("Feuil2").Range("A1:E" & Dl2).Sort Key1:=Worksheets("Feuil2").Range("a1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'copier les données dans la feuile3
Worksheets("Feuil2").Range("A1:E" & Dl2).Copy Destination:=Worksheets("Feuil3").Range("A" & Worksheets("Feuil3").Range("a" & .Rows.Count).End(xlUp).Row + 1)
Worksheets("Feuil2").Range("A1:E" & Dl2).Clear
Dl2 = 1
End If
Next Cellule1
End With
End Sub