Function periode(Optional lig As Long = 2)
Application.Volatile 'selon le besoin…
Dim c As Range, t As Integer, Cpte As Integer
Dim Cell As Range
Dim Ws As Worksheet
If lig = 0 Then lig = 4
For Each Ws In Sheets(Array("janvier", "février"))
For Each Cell In Ws.Range("C" & lig)
Set c = Range("C" & lig)
Do While IsDate(Cells(1, c.Column))
If c = "RF" Or c = "" Then
Cpte = Cpte + 1
Else
'If periode < Cpte Then periode = Cpte
Cpte = 0
End If
If periode < Cpte Then periode = Cpte
Set c = c(1, 3)
Loop
Next Cell
Next Ws
End Function