I have this code that paints (B;5) cell red, and starts moving it back and forth.
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
How to make that it would paint (B;7) and (B,9) cells and also would start moving them at the same time?