Bonsoir,
une solution avec une macro, qui manipule les données pour permettre le tri, fait le tri et remets les données en l'état,
attetntion :la macro utilise la colonne A qui est vide, s ce n'est pas le cas, les données de la colonne A seront effacées
à tester
Sub trics()
With Worksheets("feuil1")
dl = .Range("D" & Rows.Count).End(xlUp).Row
For i = 3 To dl
If .Cells(i, 4) <> "" Then
If .Cells(i, 6) <> "" Then
n = n + 10
Else
.Cells(i, 6) = .Cells(i - 1, 6)
End If
.Cells(i, 1) = n
End If
Next i
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=.Range("F2:F" & dl) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.Sort.SortFields.Add Key:=.Range("A2:A" & dl) _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.Sort.SetRange Range("A2:K" & dl)
.Sort.Header = xlYes
.Sort.MatchCase = False
.Sort.Orientation = xlTopToBottom
.Sort.SortMethod = xlPinYin
.Sort.Apply
For i = 3 To dl
If .Cells(i, 6) <> "C" Then Exit For
If .Cells(i, 1) = .Cells(i + 1, 1) Then
.Cells(i + 1, 6) = ""
End If
Next i
.Columns(1).Clear
End With
End Sub