Function Somme_devise2(PlageDevise As Range, devise As String, Optional PlageCritere As Variant, Optional critere As Variant) As Long
Dim c As Range
For Each c In PlageDevise
If IsMissing(PlageCritere) And IsMissing(critere) Then
If InStr(c.Text, devise) > 0 Then Somme_devise2 = Somme_devise2 + c
Else
If InStr(c.Text, devise) > 0 And PlageCritere(PlageCritere.Row, c.Column) = critere Then _
Somme_devise2 = Somme_devise2 + c
End If
Next c
End Function