Function Compter_Zero(Zone As Range) As Integer Dim Lig As Integer, col As Integer Dim i As Integer Dim c_zero As Integer Dim c_zero_max As Integer Lig = Zone.Rows.Row col = Zone.Columns.Column For i = col To Zone.Columns.Count + col - 1 If Cells(Lig, i) = 0 Then c_zero = c_zero + 1 Else If c_zero > c_zero_max Then c_zero_max = c_zero c_zero = 0 End If Next If c_zero > c_zero_max Then c_zero_max = c_zero Compter_Zero = c_zero_max End Function '************** Function Compter_NonZero(Zone As Range) As Integer Dim Lig As Integer, col As Integer Dim i As Integer Dim c_nonzero As Integer Dim c_nonzero_max As Integer Lig = Zone.Rows.Row col = Zone.Columns.Column For i = col To Zone.Columns.Count + col - 1 If Cells(Lig, i) > 0 Then c_nonzero = c_nonzero + 1 Else If c_nonzero > c_nonzero_max Then c_nonzero_max = c_nonzero c_nonzero = 0 End If Next If c_nonzero > c_nonzero_max Then c_nonzero_max = c_nonzero Compter_NonZero = c_nonzero_max End Function