online 1
gast (50)

/ Forum / Tabellenkalkulation

TabellenkalkulationTabellenkalkulation

Fragevon Sara12345 vom 18.04.2020, 12:55 Options

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.

Antwort 4 von Teerbaby vom 18.04.2020, 13:21 Options

Sorry, mein Fehler. Das gibts in VBA gar nicht.

Aber hoffe, das hilft dir http://forum.chip.de/basic/timer-vba-679536.html

Ähnliche Themen

Button in Userform springt auf "cancel"
Meikel  04.06.2007 - 28 Hits - 2 Antworten

Passwortübergabe per VBA
Meikel  05.06.2007 - 10 Hits - 6 Antworten

Import einer Textdatei mit Makro
Jonk  21.06.2007 - 61 Hits -

Excel Userform Auswahl , Abhängikeit
heimlichen  18.11.2007 - 62 Hits - 3 Antworten

Hilfe zur UserForm
fedjo  19.05.2008 - 55 Hits - 2 Antworten

Hinweis

Diese Frage ist schon etwas älter, Sie können daher nicht mehr auf sie antworten. Sollte Ihre Frage noch nicht gelöst sein, stellen Sie einfach eine neue Frage im Forum..

Neue Einträge

Version: supportware 1.9.150 / 10.06.2022, Startzeit:Thu Jan 8 21:07:44 2026