Sub Result()
Dim a As Variant, b As Variant
Dim i As Long, k As Long
a = Range("A1", Range("A" & Rows.Count).End(xlUp).Offset(1)).Value
ReDim b(1 To UBound(a), 1 To 1)
b(1, 1) = "Result"
For i = 2 To UBound(a)
If a(i, 1) = 1 Then
k = k + 1
Else
If a(i - 1, 1) = 1 Then
b(i - 1, 1) = k
k = 0
End If
End If
Next i
Range("B1").Resize(UBound(b)).Value = b
End Sub