Unload me funktioniert nicht !
Hallo,
wenn nicht versuche Userform zu schließen, ist das Userform weg
aber ich in dem Dokument nicht schreiben bzw. Makro button ist deaktiv.
Ich vermute es liegt an diesem code : UserForm_Activate()
Könnt ihr mir weiterhelfen?
Danke
Gruß, Sara
Hier mein Code:
Private Sub CommandButton8_Click()
If MsgBox("Beenden ? Ja, oder nein", vbYesNo) = vbYes Then
Unload Me
Else
MsgBox ("Okay, dann nicht")
End If
End Sub
Private Sub UserForm_Initialize()
TextBox1.Value = Application.UserName
End Sub
Private Sub TextBox2_Change()
TextBox2.Value = Time
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox3.Value = Format(Now, "dddd, dd.mm.yyyy")
End Sub
Private Sub UserForm_Activate()
Do
DoEvents
TextBox2.Value = Time
Loop
End Sub
Antwort schreiben
Antwort 1 von Teerbaby vom 18.04.2020, 13:03 Options
Lass die Schleife in dem Activate weg. Verwende einen Timer um die Uhrzeit zu aktualisieren.
Antwort 2 von Sara12345 vom 18.04.2020, 13:05 Options
wie mache ich das ?
bin blond :-)
Antwort 3 von Teerbaby vom 18.04.2020, 13:15 Options
Ein Timer-Control in das Form ziehen. Und dann im Tick-Ereignis die Zeit akualisieren. Intervall kannst du auf 1000 (=1 Sek.) stellen.