Ich habe da eine Userform.
Wenn in Textbox 1 acht Zeichen stehen, soll automatisch Textbox 2 aktiviert werden, so das ich dort weiter eingeben kann.
Geht so was
Bitte um eure Hilfe
Alois
Private Sub TextBox1_Change()
If BoEnter = True Then Exit Sub
If Len(TextBox1) = 2 Then
If InStr(TextBox1, ".") = 0 And BoEnter = False Then TextBox1 = TextBox1 & "."
ElseIf Len(TextBox1) = 5 Then
If Len(TextBox1) - Len(Application.Substitute(TextBox1, ".", "")) < 2 Then
TextBox1 = TextBox1 & "."
If Len(TextBox1) = 8 Then
Range("cx2").Value = TextBox1
Unload Me
End If
End If
ElseIf Len(TextBox1) = 8 Then
End If
Range("cx2").Value = TextBox1
End Sub
Private Sub TextBox2_Change()
If BoEnter = True Then Exit Sub
If Len(TextBox2) = 2 Then
If InStr(TextBox2, ".") = 0 And BoEnter = False Then TextBox2 = TextBox2 & "."
ElseIf Len(TextBox2) = 5 Then
If Len(TextBox2) - Len(Application.Substitute(TextBox2, ".", "")) < 2 Then
TextBox2 = TextBox2 & "."
If Len(TextBox2) = 8 Then
Range("cx3").Value = TextBox2
Unload Me
End If
End If
ElseIf Len(TextBox2) = 8 Then
Application.OnTime Now + _
TimeSerial(0, 0, 1), "Filter_Datumbereich"
Application.OnTime Now + TimeValue("00:00:03"), "Schließenform2"
End If
Range("cx3").Value = TextBox2
End Sub