Tante Google konnte mir nicht wirklich weiterhelfen. Wie kann ich einer Texttext im Userform beibringen, dass sie nur Datumswerte ( TT.MM.JJJJ) annehmen darf?
Gruß tursiops
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsDate(TextBox1) = False Then
MsgBox "Das ist kein valables Datum"
Cancel = True
End If
End Sub
GreetZ Renée
Private Sub CommandButton1_Click()
If Not TextBox1 Like "dd.mm.yyyy" Then
TextBox1.SetFocus
MsgBox "Eingabe in Textbox ist Falsch"
Exit Sub
End If
'anderer Code
'...
End Sub
Gruß Tino
Private Sub CommandButton1_Click()
If Not (TextBox1 Like "?.?.?" And IsNumeric(TextBox1)) Then
TextBox1.SetFocus
MsgBox "Eingabe in Textbox ist Falsch"
Exit Sub
End If
'anderer Code
End Sub