Sub comptage_pour_mois_precedent()
Dim moisencours As String
Dim moisprecedent As String
moisencours = Format(DateSerial(Year(Date), Month(Date), 1), "mm yyyy")
moisprecedent = Format(DateSerial(Year(Date), Month(Date) - 1, 1), "mm yyyy")
For x = Sheets("f").Range("a65536").End(xlUp).Row To 1 Step -1
If [COLOR=Red]Format(Range("a" & x), "mm yyyy") [/COLOR]= moisprecedent Then
y = Range("b" & [COLOR=Red]x[/COLOR]).Value + y
End If
Next
MsgBox y
End Sub