|
本帖最后由 weiyingde 于 2019-10-30 12:15 编辑
仍然可以用循环,只不过数字更新的时间更长,要24小时,86400秒,不易测试效果,可将86400改成60秒,看看效果。
代码如下:
Private Sub CommandButton1_Click()
Dim shp As Shape, i%
'On Error Resume Next
With ActivePresentation.SlideShowWindow.View.Slide
With .Shapes("数字")
For i = 1 To 1000
.Fill.BackColor.RGB = RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255))
With .TextFrame.TextRange
.Font.Name = Array("宋体", "楷体", "Arial Black", "Arial Narrow")(Int(Rnd * 4))
.Text = N
.Font.Size = 140
.Font.Bold = True
.Font.Color.RGB = RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255))
End With
tm1 = Timer
Do
DoEvents
Loop While Timer - tm1 < 5
If i = 1000 Then MsgBox "时间到!", vbCritical, Space(12) + "提示"
N = N + 1
Next
End With
End With
End Sub
|
|