爱疯 发表于 2016-6-14 11:50
Sub around()
Dim rng As Range, temp As Range
Dim top(), arr()
Sub 跑马灯()
s = Int((16 * Rnd))
Range("A4") = s
k = s Mod 16
For j = 1 To 3
For i = 0 To 15
Range("D5:H9").Interior.Pattern = xlNone
If i <= 3 Then
Range("D5").Offset(0, i).Interior.Color = 65535
Call delay(0.1)
Else
If i > 3 And i <= 7 Then
Range("H5").Offset(i - 4, 0).Interior.Color = 65535
Call delay(0.1)
Else
If i > 7 And i <= 11 Then
Range("H9").Offset(0, 8 - i).Interior.Color = 65535
Call delay(0.1)
Else
If i > 11 And i <= 15 Then
Range("D9").Offset(12 - i, 0).Interior.Color = 65535
Call delay(0.1)
End If
End If
End If
End If
Next
Next
For T = 0 To k
Range("D5:H9").Interior.Pattern = xlNone
If T <= 3 Then
Range("D5").Offset(0, T).Interior.Color = 65535
Call delay(0.1)
Else
If T > 3 And T <= 7 Then
Range("H5").Offset(T - 4, 0).Interior.Color = 65535
Call delay(0.1)
Else
If T > 7 And T <= 11 Then
Range("H9").Offset(0, 8 - T).Interior.Color = 65535
Call delay(0.1)
Else
If T > 11 And T <= 15 Then
Range("D9").Offset(12 - T, 0).Interior.Color = 65535
Call delay(0.1)
End If
End If
End If
End If
Next
End Sub
Sub delay(T As Single)
Dim time1 As Single
time1 = Timer
Do
DoEvents
Loop While Timer - time1 < T
End Sub
根据这个代码实现的功能,请问大神们,可不可以让其实现随机旋转,不是固定的三圈,同时还能实现自动暂停及报数
|