Так что я не уверен, как вы хотите, чтобы результаты форматировались, но я предполагаю, что это будет 2 ячейки справа от информации, которую вы имеете выше, 1 для количества пробелов и 1 для показа максимального GAP. Приведенный ниже код может помочь, но изменения должны быть сделаны в зависимости от количества проверяемых строк / столбцов.
Sub Finder()
Dim X As Integer
Dim Y As Integer
Dim GapCounter As Integer
Dim MaxCounter As Integer
'This For statement should be change according to how many rows need to be done
For c = 2 To 3
GapCounter = 0
MaxCounter = 0
'This For statement should be changed according to how many columns are being viewed.
For Y = 1 To 11
'This will check to see if the next column is a 0, if so a gap is beginning and the gap counter will increase
If Cells(c, Y).Value <> 0 And Cells(c, Y + 1).Value = 0 And IsEmpty(Cells(c, Y + 1)) = False Then GapCounter = GapCounter + 1
'This is checking value,if value is 0 need to add it to the current Gap amount
If Cells(c, Y).Value = 0 Then MaxCounter = MaxCounter + 1
'Checks to see if the next value is not a 0 and is not empty, if these are met we can conclude that's all the gap that needs to be counted and compare to the previous Max gap #, if it's larger than we replace
'Then we have to reset the max counter
If Cells(c, Y + 1).Value <> 0 And IsEmpty(Cells(c, Y + 1)) = False And MaxCounter > Cells(c, 14).Value Then
'This is the cell where the max time a gap has lasted will appear.
Cells(c, 14).Value = MaxCounter
MaxCounter = 0
End If
Next
'This is the cell where the # of gaps will appear
Cells(c, 13).Value = GapCounter
Next
End Sub