AW: Format - Datum 1900
24.10.2005 18:04:19
marc
Hallo Ingo,
danke für dein Tipp.Das Problem "Datum-1900" habe ich etwas anders gelöst.
Ich musste alles umschreiben aber es funktioniert fehlerfrei.
Option Explicit
Private Sub CommandButton1_Click()
Set frm = UserForm1
Sheets("PointI").Activate
Range("L65536").End(xlUp).Offset(0, 0).Select
With frm
ActiveCell.Value = .TextBox1.Value
ActiveCell.Offset(0, 1).Value = .TextBox2.Value
End With
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub CommandButton3_Click()
Dim tb As Object
For Each tb In UserForm1.Controls
If TypeName(tb) = "TextBox" Then tb.Text = ""
Next tb
End Sub
Private Sub TextBox1_Enter()
HintergrundFärben
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
HintergrundZurücksetzen
End Sub
Private Sub TextBox2_Enter()
HintergrundFärben
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
HintergrundZurücksetzen
End Sub
Private Sub HintergrundFärben()
Me.ActiveControl.BackColor = RGB(255, 0, 0)
End Sub
Private Sub HintergrundZurücksetzen()
Me.ActiveControl.BackColor = RGB(255, 255, 255)
End Sub
Private Sub TextBox1_AfterUpdate()
If Not IsDate(TextBox1) Then
MsgBox "Kein gültiges Datum!", vbCritical, "Datumsformat falsch"
Exit Sub
End If
TextBox1 = Format(TextBox1, "mm/dd/yyyy")
End Sub
Private Sub TextBox2_AfterUpdate()
If Not IsDate(TextBox2) Then
MsgBox "Kein gültiges Datum!", vbCritical, "Datumsformat falsch"
Exit Sub
End If
TextBox2 = Format(TextBox2, "mm/dd/yyyy")
End Sub
Gruss
-
marc ....:o)