[COLOR="DarkSlateGray"][B]Function EcartMax1&(Plage As Range)
Dim i&, n&, dat
With Plage
dat = Range(.Cells(1, 1), _
Cells(WorksheetFunction.Max(.Cells(1, 1).Row, _
Cells(WorksheetFunction.Min(Rows.Count, .Cells(1, 1).Row + .Rows.Count), _
.Cells(1, 1).Column).End(xlUp).Row), .Cells(1, 1).Column)).Value
If VarType(dat) >= vbArray Then
For i = 1 To UBound(dat, 1)
If dat(i, 1) = "" Then
n = n + 1
If n > EcartMax1 Then EcartMax1 = n
Else
n = 0
End If
Next
End If
End With
End Function
Function EcartMax2&(Plage As Range)
Dim ib&, ic&, ih&, i&, n&
With Plage
ib = .Cells(1, 1).Row
ic = .Cells(1, 1).Column
ih = Cells(WorksheetFunction.Max(ib, Cells(WorksheetFunction.Min(Rows.Count, ib + .Rows.Count), ic).End(xlUp).Row), ic).Row
If ib <> ih Then
For i = ib To ih
If Cells(i, ic).Value = "" Then
n = n + 1
If n > EcartMax2 Then EcartMax2 = n
Else
n = 0
End If
Next
End If
End With
End Function
Function EcartMax3&(Plage As Range)
Dim i&, n&, dat
With Plage
dat = .Value
If VarType(dat) >= vbArray Then
For i = 1 To UBound(dat, 1)
If dat(i, 1) = "" Then
n = n + 1
If n > EcartMax3 Then EcartMax3 = n
Else
n = 0
End If
Next
End If
End With
End Function
Function EcartMax4&(Plage As Range)
Dim i&, n&
With Plage
For i = 1 To .Columns(1).Cells.Count
If .Cells(i, 1).Value = "" Then
n = n + 1
If n > EcartMax4 Then EcartMax4 = n
Else
n = 0
End If
Next
End With
End Function[/B][/COLOR]