Sub test()
Dim Arr, V&, N&
Arr = Range([a1], [a65536].End(3)(2))
For i = 2 To UBound(Arr) - 1
V = Val(Arr(i, 1)): Arr(i, 1) = ""
If V = 0 Then GoTo 101 Else N = N + 1
If Val(Arr(i + 1, 1)) = 0 Then Arr(i, 1) = N: N = 0
101: Next
Arr(1, 1) = "µn¿ý"
[b1].Resize(UBound(Arr) - 1, 1) = Arr
End Sub
½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
Sub test()
Dim Arr, Brr(), T0%, T%, T1%, s
Arr = Range([a1], [a65536].End(3))
ReDim Brr(1 To UBound(Arr), 1 To 1)
For i = 2 To UBound(Arr)
If i > 2 Then T0 = Arr(i - 1, 1)
T = Arr(i, 1)
If i < UBound(Arr) Then
T1 = Arr(i + 1, 1)
Else
If T <> 0 Then Brr(i, 1) = i - s
End If
If T = 0 Then
s = i
Else
If T1 = 0 And s <> "" Then: Brr(i, 1) = i - s
End If
Next
[b1].Resize(UBound(Arr), 1) = Brr
[b1] = "µn¿ý"
End Sub