Hallo !
Ich hätte wieder mal eine Frage.
Was muß ich in u.a. Code für die Userform ändern, damit weiterhin das Datum vorbelegt ist, jedoch bei Eintrag eines neuen Datums keine Punkte
(z.B.Eintrag 14062023 erscheint dann mit Punkt..........also 14.06.2023) eingetragen werden müssen.
Danke für Eure Hilfe
chris58
Private Sub txt_Datum1_AfterUpdate()
If IsDate(txt_Datum1.Value) Then
lblErgebnis = CDate(txt_Datum2.Value) - CDate(txt_Datum1.Value)
Else
MsgBox "Kein Datum"
txt_Datum1.Value = Date
End If
End Sub
Private Sub txt_Datum2_AfterUpdate()
If IsDate(txt_Datum2.Value) Then
lblErgebnis = CDate(txt_Datum2.Value) - CDate(txt_Datum1.Value)
Else
MsgBox "Kein Datum"
txt_Datum2.Value = Date
End If
End Sub
Private Sub UserForm_Initialize()
txt_Datum1.Value = Date
txt_Datum2.Value = Date
lblErgebnis = CDate(txt_Datum2.Value) - CDate(txt_Datum1.Value)
End Sub