Ich habe ein UserForm.
Mit folgentem Code befülle ich unter anderem 2 Textboxen.
TextBoxAustrittsjahr.Text = Cells(a, 13).Text
TextBoxListeJahr.Text = ActiveSheet.Range("A1").Value
TextBoxListeJahr.Text = Format(TextBoxListeJahr, "yyyy")
Durch einen Commandbutton werden noch einige Abfragen ausgelöst.
z.B.:
If ComboBox_Mitglied.Text = "" Then
MsgBox "Bitte XXXXXX auswählen"
ComboBox_Mitglied.SetFocus
Exit Sub
End If
If TextBoxAustrittsjahr.Text = "" Then
MsgBox "Bitte XXXXXXX eintragen"
Exit Sub
End If
Jetzt bräuchte ich noch folgende Abfrage:
In Textbox TextBoxListeJahr steht immer der 01.01. eines Jahres im Format YYYY.
In Textbox TextBoxAustrittsjahr steht ein Datum im Format dd.mm.yyyy
Ist das Jahr aus Textbox TextBoxAustrittsjahr gleich oder größer als das Jahr in TextBoxListeJahr soll eine MsgBox aufgerufen werden.
Kann mir das bitte Jemand zusammenbasteln.
Vielen Dank für die Hilfe.
mfg, Andreas