Sub macro()
Dim i As Byte, j As Byte
Dim Indice As Integer, Nb_rep As Integer
j = 2
Sheets('Feuil1').Select
ActiveSheet.UsedRange.Select
Selection.Sort Key1:=Range('A1'), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Selection.Copy
Sheets('RécapFin').Select
Range('A1').Select
ActiveSheet.Paste
Columns('B:C').Select
Selection.Delete
For i = 2 To Range('A65536').End(xlUp).Row
Do While Cells(j, 1).Value = Cells(j + 1, 1).Value
If Cells(j + 1, 1).Value = '' Then Exit Sub
Indice = Cells(j, 2).Value + Indice
Nb_rep = Cells(j, 3).Value + Nb_rep
If Cells(j + 1, 3).Value <> '' Then
Rows(j).Delete
Else
j = j + 1
End If
Loop
Indice = Cells(j, 2).Value + Indice
Nb_rep = Cells(j, 3).Value + Nb_rep
Cells(i, 2).Value = Indice
Cells(i, 3).Value = Nb_rep
Cells(i + 1, 2).Value = ''
Cells(i + 1, 3).Value = ''
Indice = 0
Nb_rep = 0
j = j + 1
i = i + 1
Next i
End Sub