Sub EcartMax()
Dim Chaine As String, n As Integer, i As Integer, k As Integer, Ecart As Variant
Chaine = Replace(Range("A1"), " ", "")
n = Len(Chaine)
Ecart = 0
For i = 1 To n
If Mid(Chaine, i, 1) = 1 Then
For k = i + 1 To n
If Mid(Chaine, k, 1) = 1 Then
Ecart = Ecart & ", " & Len(Mid(Chaine, i, k - i))
Exit For
GoTo suite
End If
Next k
End If
suite:
Next i
MsgBox Evaluate("MAX(" & Ecart & ")")
End Sub