Bonjour Hemed, AlgoPlus, le forum,
Peut-être ainsi....
Sub test()
Dim s, DerL, i
Dim plage As Range
With Sheets("départ")
DerL = .Range("A" & Rows.Count).End(xlUp).Row
s = 0
For i = 3 To DerL
Set plage = .Range("A" & i & ":W" & DerL)
If .Cells(i, 1) = "pb2" Then
s = s + Application.VLookup(.Cells(i, 1), plage, 7, False)
End If
Next i
End With
MsgBox s
End Sub
CTRL + E pour exécuter la macro
Une variante avec Somme.Si
Sub test()
Dim s, DerL
Dim plagecritere As Range, plageresultat As Range
With Sheets("départ")
DerL = .Range("A" & Rows.Count).End(xlUp).Row
Set plagecritere = .Range("A3:A" & DerL)
Set plageresultat = .Range("G3:G" & DerL)
s = Application.WorksheetFunction.SumIf(plagecritere, "pb2", plageresultat)
End With
MsgBox s
End Sub
Cordialement,