Sub somme()
Dim DernLig As Long, n As Long, compteur As Double
DernLig = Cells(Rows.Count, 1).End(xlUp).Row
compteur = 0
For n = 1 To DernLig
If Cells(n, 1) = Cells(n + 1, 1) Then
compteur = compteur + Cells(n, 3)
Else
Cells(n, 4) = compteur + Cells(n, 3)
compteur = 0
End If
Next n
End Sub