Option Explicit
Sub MoisPrecedent()
Dim i As Long
For i = 2 To 13
If Month(Range("A" & i)) <> Month(Now) Then
Range("E2") = i
Exit For
End If
Next i
End Sub
Merci cela me va .Bonjour
le mois en cours étant MAI, le résultat va etre la deuxième ligne, et non 5
VB:Option Explicit Sub MoisPrecedent() Dim i As Long For i = 2 To 13 If Month(Range("A" & i)) <> Month(Now) Then Range("E2") = i Exit For End If Next i End Sub
PS: je ne vois pas trop à quoi ca peut servir..