Habe eine userform, in der in den textboxes werte eingegeben werden.
nun passiert es, wenn in irgendeine Textbox nichts eingegeben wird und die übrigen werte übernommen werden sollen, dass eine Fehlermeldung herausspringt.
Wie kann ich es machen, dass auch leere Textboxes übernommen werden?
Hängt das vielleicht mit CLng... zusammen? Wenn ja, wie kann ich dieses abstellen? Die CLng-Formatierung brauche ich aber.
Private Sub CommandButton1_Click()
If CommandButton1 = False Then
If Msgbox("Alle Eingaben richtig?", vbYesNo + vbDefaultButton1, "ACHTUNG") = vbYes Then
For i = 1 To 34
k = 11
If TextBox55.Text = i Then
Worksheets("Liga1").Activate
Cells(3 + (i * k) - k, 4) = CLng(TextBox28)
Cells(3 + (i * k) - k, 5) = CLng(TextBox37)
Cells(4 + (i * k) - k, 4) = CLng(TextBox29)
Cells(4 + (i * k) - k, 5) = CLng(TextBox38)
Cells(5 + (i * k) - k, 4) = CLng(TextBox30)
Cells(5 + (i * k) - k, 5) = CLng(TextBox39)
Cells(6 + (i * k) - k, 4) = CLng(TextBox31)
Cells(6 + (i * k) - k, 5) = CLng(TextBox40)
Cells(7 + (i * k) - k, 4) = CLng(TextBox32)
Cells(7 + (i * k) - k, 5) = CLng(TextBox41)
Cells(8 + (i * k) - k, 4) = CLng(TextBox33)
Cells(8 + (i * k) - k, 5) = CLng(TextBox42)
Cells(9 + (i * k) - k, 4) = CLng(TextBox34)
Cells(9 + (i * k) - k, 5) = CLng(TextBox43)
Cells(10 + (i * k) - k, 4) = CLng(TextBox35)
Cells(10 + (i * k) - k, 5) = CLng(TextBox44)
Cells(11 + (i * k) - k, 4) = CLng(TextBox36)
Cells(11 + (i * k) - k, 5) = CLng(TextBox45)
End If
Unload UserForm1
Next i
End If
End If
End Sub
Danke
Jens