Sub Recherche()
Dim a(), d As New Dictionary, i As Long, an1 As Long, an2 As Long, Periode$
Application.ScreenUpdating = False
a = Worksheets("Commande").UsedRange.Value
With Worksheets("Résultat")
.Range("A2:A100").ClearContents
an1 = .Range("B2").Value: an2 = .Range("C2").Value
Periode$ = .Range("D2").Value
For i = 2 To UBound(a)
If Year(a(i, 1)) = an1 And a(i, 11) Like Periode Or Year(a(i, 1)) = an2 And a(i, 11) Like Periode Then 'needed date
d(a(i, 5)) = a(i, 5)
End If
Next
If d.Count >= 1 Then
.Range("A2").Resize(d.Count) = Application.Transpose(d.Items)
Else
.Range("A2").Value = d.Item(1)
End If
.Range("A2:A" & .Cells(.Rows.Count, 1).End(xlUp).Row).Sort key1:=.Range("A2"), order1:=xlAscending, Header:=xlYes
End With
Application.ScreenUpdating = True
End Sub