folgende Codes für ein CountDown habe ich hier aus dem Forum:
Sub Los()
Start = True
[a1] = 3 / 60 / 24
Call Countdown
Cells(1, 1).Select
End Sub
Sub Anhalten()
Start = False
[a1] = 180 / 86400
Cells(1, 1).Select
End Sub
Sub Countdown()
[a1] = [a1] - 1 / 86400
If Start Then
Application.OnTime Now + TimeValue("00:00:01"), "Countdown"
End If
End Sub
Dies möchte ich gerne mit einer Userform in Verbindung bringen. Hier meine misslungenen Vorschläge:
Für die UserForm:
Private Sub CommandButton1_Click()
'Start
Start = True
TextBox1.Value = Format(3 / 60 / 24, "m:ss")
Call Zaehlab
End Sub
Private Sub CommandButton2_Click()
'Stopp
Start = False
TextBox1.Value = Format(180 / 86400, "m:ss")
End Sub
Private Sub CommandButton3_Click()
UserForm1.Hide
End Sub
Und im Modul:
Sub Zaehlab()
UserForm1.TextBox1.Value = Format((UserForm1.TextBox1.Value - 1 / 86400), "m:ss")
If Start Then
Application.OnTime Now + TimeValue("00:00:01"), "Zaehlab"
End If
End Sub
Beim Ausführen gibt es im "Zaehlab" ein Laufzeitfehler.
Wer kann mir helfen?
Danke und Gruss
Xico