Probleme mit IsNumeric auf Basic Edition 2003
07.09.2007 12:53:00
Peter
in meinem Tool kontrolliere ich die Eingabe in mehreren Textfelder nach Zahlen.
In einigen Feldern sol ein Datum eingetragen werden in anderen normale Zahlen.
Ich habe das Tool mit Excel 2003 Professional gefertigt. Auf Small Business 2003 läuft es auch nur nicht auf Basic Edition 2003. Dort erkennt Excel nicht die Kontrolle nach Zahlen (über IsNumeric). Es erscheint nach der Eingabe des Datums immer meine MsgBox "Geben Sie ein gültiges Datum im Format dd.mm.yy ein" . Ich glaube zumindest das es an IsNumeric liegt!
Hier einer meiner Codes zur Datum Kontrolle:
Private Sub txtDatum_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If txtDatum "" Then
If Len(txtDatum) 8 Then
MsgBox "Geben Sie ein gültiges Datum im Format dd.mm.yy ein"
txtDatum = ""
Cancel = True
ElseIf InStrRev(txtDatum, ".") 6 And InStr(1, txtDatum, ".") 3 Then
MsgBox "Geben Sie ein gültiges Datum im Format dd.mm.yy ein"
txtDatum = ""
Cancel = True
ElseIf Not IsNumeric(txtDatum.Text) = True Then
MsgBox "Geben Sie ein gültiges Datum im Format dd.mm.yy ein"
txtDatum.Text = ""
Cancel = True
ElseIf CDate(txtDatum.Text)
Weiss jemand wo das Problem ist?
Danke im Voraus
Grüße aus Berlin