Das rein raus Springen bekomme ich hin aber das mit der Zeit nicht. Während die Zeit abläuft sollen andere Aktionen möglich sein, ein reines warten geht in diesem fall nicht
Option Explicit
Private Sub CommandButton1_Click()
If CommandButton2.Enabled = True Then
CommandButton2.Enabled = False
CommandButton3.Enabled = False
Start
Else
CommandButton2.Enabled = True
CommandButton3.Enabled = True
End If
End Sub
Option Explicit
Option Private Module
Dim Bol As Boolean
Sub Start()
Dim xZeit As Date, yZeit As Date
xZeit = Time
yZeit = xZeit + (10 / 86400) '10/86400 sind 10 Sekunden
Bol = False
Do
DoEvents
If Time >= yZeit Then GoTo UMSCHALT
Loop While Bol True
Exit Sub
UMSCHALT:
Bol = True
UserForm1.CommandButton2.Enabled = True
UserForm1.CommandButton3.Enabled = True
End Sub