10秒后出现按钮

时间:2014-06-19 00:12:54

标签: vba excel-vba excel

我创建了一个按钮,在我的工作簿加载后,我希望我的按钮在10秒后(不是马上)出现。

Dim ButtonOneClick As Boolean
Sub Button3_Click()
Sub disenable()
    Dim b1 As Button
    Set b1 = Sheets("Sheet2").Button3_Click()
    Sheets("Sheet2").Button3_Click.Enabled = False
    DoEvents
    Application.ScreenUpdating = True
    For i = 1 To 10
        Application.Wait (Now + TimeValue("0:00:1"))
    Next i
    'Sheets(1).button1.Enabled = False
End Sub

1 个答案:

答案 0 :(得分:3)

尝试激活工作表或根据需要进行调整

Private Sub Worksheet_Activate()
Me.Buttons("Button 1").Visible = False
Application.ScreenUpdating = True
Application.Wait (Now + #12:00:10 AM#)
Me.Buttons("Button 1").Visible = True
End Sub