Sub cartman()
For i = 3 To 14
'si tu rajoute une colonne a la 4eme colonne si la case est nul on fais le calcul
if cells(i,4) = 0 then
If Cells(i, 2) = "Patates" Then
total_P = total_P + Cells(i, 3)
ElseIf Cells(i, 2) = "Haricots" Then
total_H = total_H + Cells(i, 3)
End If
endif
Next i
Cells(24, 2) = total_P
Cells(25, 2) = total_H
End Sub