Bonjour KOBD, h2so4,
je propose ce code VBA (à tester) :
Option Explicit
Sub testsia()
Dim Tablo, codeP$, somme#, dlig&, n&, i&, j&
Worksheets("SUIVTRANS EN COURS").Select
dlig = Cells(Rows.Count, "M").End(xlUp).Row
If dlig > 2 Then Range("M3:M" & dlig).ClearContents
dlig = Cells(Rows.Count, "K").End(xlUp).Row
Tablo = Range("J3:K" & dlig): n = dlig - 2
dlig = Cells(Rows.Count, "A").End(xlUp).Row
For i = 3 To dlig
codeP = Cells(i, "H"): somme = 0
For j = 1 To n
If Cells(i, "J") = Tablo(j, 1) Then
If Cells(j + 1, "H") = codeP Then _
somme = somme + CDbl(Tablo(j, 2))
End If
Next j
Cells(i, "R") = somme
Next i
End Sub
dhany