试着在这个版块发一下VBA代码:

程序代码:
Sub 循环投()
Dim row1 As Integer, row2 As Integer, irow As Integer, iArray As Integer
Dim qqq()
Dim lCanChipin As Boolean
row1 = 2: row2 = 67
qqq = Array(1, 2, 4, 8, 18, 38, 82)
irow = row1
Range(Cells(row1, 5), Cells(row2, 5)).Clear
Do Until irow > row2
If lCanChipin Then
iArray = 0
Do Until iArray > UBound(qqq)
Cells(irow, 5) = qqq(iArray)
If Cells(irow, 2) = True Then
iArray = 0
Else
iArray = iArray + 1
End If
If iArray <= UBound(qqq) Then irow = irow + 1
Loop
If Cells(irow, 2) = False Then
lCanChipin = False
Else
End If
irow = irow + 1
Else
If Cells(irow, 2) = False Then
Cells(irow, 5) = 0
Else
Cells(irow, 5) = 0
lCanChipin = True
End If
irow = irow + 1
End If
Loop
MsgBox "判断完毕。", vbInformation, "提示:"
End Sub
[此贴子已经被作者于2019-12-6 11:12编辑过]