|
参与一下。。。- Sub ykcbf() '//2024.1.14
- Dim arr, brr(1 To 10000, 1 To 1), zrr(1 To 1000)
- mm = Val(Application.InputBox("请输入循环开始数:", "起始数", 8))
- If mm = 0 Then Exit Sub
- On Error Resume Next
- n = 0
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .Range("a1:e" & r)
- For i = 5 To UBound(arr) + 1
- If arr(i, 5) = 0 Then
- n = n + 1
- zrr(n) = Array(i, i)
- End If
- If i = r Then zrr(n)(1) = r
- If arr(i + 1, 5) = 0 Then zrr(n)(1) = i
- Next
- For x = 1 To n
- For y = zrr(x)(0) To zrr(x)(1)
- m = m + 1
- brr(m, 1) = mm + x - 1
- Next
- Next
- m = m - 1
- .[h5:h10000] = ""
- .[h5].Resize(m, 1) = brr
- End With
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
|