我有这个代码描绘了(B;5)
单元格红色,并开始移动它来回移动。Excel VBA同时发布多个宏
Declare Sub Sleep Lib "kernel32" (ByVal dwMillisecons As Long)
Private Sub Button1_Click()
Move
End Sub
Sub Move()
gr = 1
st = 1
While Cells(2, 2) = 0
If st > 1 Then
Cells(5, st - 1).Clear
End If
Cells(5, st + 1).Clear
Cells(5, st).Interior.Color = vbGreen
st = st + gr
If st > 48 Then
gr = -1
End If
If st < 2 Then
gr = 1
End If
Sleep 100
DoEvents
Wend
End Sub
如何使这将油漆(B;7)
和(B,9)
细胞,也将开始在同一时间移动它们?
什么是你的代码吗? –
它以绿色绘制细胞,并开始来回移动。 – Faux