Bonsoir
La macro n’est pas optimisée pour un nombre important de lignes.
voici un code optimisé pour un grand nombre de lignes.( cfr Jacques Boisgontier)
Sub aargh()
With Sheets("feuil1")
dl = .Cells(Rows.Count, 1).End(xlUp).Row
a = .Range("L1:L" & dl)
For i = 6 To dl
a(i, 1) = 0
If .Cells(i, 2) = ck Then
If .Cells(i, 11) <= .Cells(vmin, 11) Then
a(vmin, 1) = "X"
vmin = i
Else
a(i, 1) = "X"
End If
Else
ck = .Cells(i, 2)
vmin = i
End If
Next i
.Range("L1:L" & dl) = a
.Range("A6:L" & dl).Sort key1:=.Range("L6"), order1:=xlAscending, Header:=xlNo
.Range("L6:L" & dl).SpecialCells(xlCellTypeConstants, 2).EntireRow.Delete
.Range("L:L").Delete shift:=xlToLeft
End With
End Sub