Private Sub UserForm_Initialize()
If Cells(1, 1) <> 0 Then Cells(1, 1) = 0
UserForm1.Image2.Enabled = False
UserForm1.Image2.Visible = False
Call aa
End Sub
Private Sub CommandButton1_Click()
Application.OnTime Now + TimeValue("00:00:01"), "aa", schedule:=False
End Sub
Sub aa()
Application.OnTime Now + TimeValue("00:00:01"), "aa", schedule:=True
Cells(1, 1) = Cells(1, 1) + 1
If Cells(1, 1) > 5 Then UserForm1.Image1.Visible = False
If Cells(1, 1) > 5 Then UserForm1.Image2.Visible = True
If Cells(1, 1) > 10 Then Application.OnTime Now + TimeValue("00:00:01"), "aa", schedule:=False
With UserForm1.Image2
.Picture = LoadPicture("d:\" & Int(11 * Rnd + 1) & ".jpg")
.Move 120, 10, 100, 100
.PictureSizeMode = fmPictureSizeModeStretch
End With
With UserForm1.Image1
.Picture = LoadPicture("d:\" & Int(11 * Rnd + 1) & ".jpg")
.Move 10, 10, 100, 100
.PictureSizeMode = fmPictureSizeModeStretch
End With
End Sub
uj5u.com熱心網友回復:
標題你想做一件事情,內容是你做這件事情的代碼。屬于炫耀帖吧,CSDN的傳統,這種帖子樓主要散分的。
uj5u.com熱心網友回復:
我炫耀,我一共100多分,散什么分,炫耀什么,上代碼為了答題的人看著方便,你可以不回答,不要胡說八道,你沒有回答問題的能力可以回避
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/284450.html
標籤:VBA
下一篇:Aria2c指定目錄失敗!
