Function MAXCONGES(plage As Range) As Byte
Dim cel As Range, txt As String, s
Dim ub As Integer, tablo() As Byte, i As Byte
For Each cel In plage
If cel.Interior.ColorIndex = xlNone Then 'week-end ignoré
If cel Then txt = txt & 1 Else txt = txt & " "
End If
Next
txt = Application.Trim(txt) 'fonction SUPPRESPACE
s = Split(txt) 'l'espace est le séparateur par défaut
ub = UBound(s)
If ub >= 0 Then
ReDim tablo(ub)
For i = 0 To ub
tablo(i) = Len(s(i))
Next
MAXCONGES = Application.Max(tablo) / 2
End If
End Function