Bonsoir,
Voilà une solutions par macro
Option Explicit
Sub TRI()
'
' tri Macro
Dim compteur As Integer
Dim i As Long
Dim rang As Long
Range("A1:B11").Select
Selection.Sort Key1:=Range("b1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("D4").Select
For i = 2 To Range("b65536").End(xlUp).Row
rang = i
compteur = 0
Do
rang = rang + 1
compteur = compteur + 1
Cells(rang - 1, 1) = compteur
Loop Until Cells(rang, 2) <> Cells(rang - 1, 2)
i = rang - 1
Next
End Sub
bonne soirée
@+Vincent