Bonsoir,
A mettre dans le module de l'UF :
Private Sub CommandButton2_Click()
Dim oSomme As Double, Lig As Long
If TextBox3 >= "01" And TextBox3 <= "12" Then
With ThisWorkbook.Worksheets("Feuil2")
For Lig = 2 To .UsedRange.Rows.Count
If IsDate(.Cells(Lig, "D").Value) And .Cells(Lig, "D").Value <> "" Then
If .Cells(Lig, "A").Text = ComboBox2.Text And Format(Month(.Cells(Lig, "D").Value), "00") = TextBox3.Text Then
oSomme = oSomme + .Cells(Lig, "C").Value
End If
End If
Next Lig
End With
End If
TextBox2.Value = oSomme
End Sub
Si tu dois avoir des centaines de lignes, il faudrait peut-être passer par une formule Excel qui devrait être plus rapide (dépend du contexte).
A+
Benoît Marchand
[Benead]