Sub extraire()
Dim tablo() As Variant
With Sheets("Feuil1")
fin = .Range("A" & .Rows.Count).End(xlUp).Row
tablo = .Range("A2:E" & fin).Value
End With
For i = LBound(tablo, 1) To UBound(tablo, 1) - 1
If tablo(i, 1) <> tablo(i + 1, 1) Then
For j = LBound(tablo, 1) To i
If tablo(j, 1) = tablo(i, 1) Then
SommeEnt1 = SommeEnt1 + IIf(tablo(j, 3) <> "", tablo(j, 3), 0)
SommeEnt2 = SommeEnt2 + IIf(tablo(j, 4) <> "", tablo(j, 4), 0)
SommeEnt3 = SommeEnt3 + IIf(tablo(j, 5) <> "", tablo(j, 5), 0)
If j <> i Then
For k = LBound(tablo, 2) To UBound(tablo, 2)
tablo(j, k) = ""
Next k
End If
End If
Next j
tablo(i, 3) = SommeEnt1
tablo(i, 4) = SommeEnt2
tablo(i, 5) = SommeEnt3
End If
Next i
With Sheets("Feuil2")
Application.DisplayAlerts = False
.Columns("A:E").ClearContents
.Range("A2").Resize(UBound(tablo, 1), UBound(tablo, 2)) = tablo
.Range("A2").Resize(UBound(tablo, 1), UBound(tablo, 2)).AutoFilter Field:=1, Criteria1:="="
.Range("A2").Resize(UBound(tablo, 1), UBound(tablo, 2)).SpecialCells(xlCellTypeVisible).Delete
Application.DisplayAlerts = True
End With
End Sub