Sub AllerRetour(Sh As Object)
Dim t, i&, j As Variant
Sh.UsedRange.Sort Sh.Cells(1), xlAscending, Header:=xlNo 'tri sur les dates
With Sh.UsedRange.Resize(, 7)
.Columns(7) = "=B1&C1"
t = .Value 'matrice, plus rapide
For i = 1 To UBound(t)
j = Application.Match(t(i, 3) & t(i, 2), .Columns(7), 0)
If IsError(j) Then j = i
t(i, 7) = IIf(j < i, j, i)
Next
.Columns(7) = Application.Index(t, , 7)
.Sort .Columns(7), xlAscending, Header:=xlNo
.Columns(8) = "=1/(G1=G2)"
.Columns(8) = .Columns(8).Value 'supprime les formules
.Columns(8).SpecialCells(xlCellTypeConstants, 1).EntireRow.Insert
End With
Sh.Columns("G:H").ClearContents 'RAZ des colonnes auxiliaires
End Sub