ich habe eine UF, die mit einigen Texboxen gefüllt ist. Drei davon werden nach Bedarf mit einem Datum gefüllt und bleiben sonst leer. Nun habe ich das Problem, wenn diese TextBox leer bleibt, bekomme ich die Fehlermeldung "Laufzeitfehler 13 Typen unverträglich" .
Vielleicht habt Ihr ja eine Idee, wie dieses Problem behoben werden kann und ich die eingegeben Daten in meiner UF an das Ziel Arbeitsblatt übergeben kann.
Private Sub CommandButton1_Click()
ActiveSheet.Unprotect Password:=""
Dim FinalRow As Long
FinalRow = ActiveSheet.ListObjects(1).ListRows.Count + 4
Cells(FinalRow, 13).Value = UserForm1.TextBox1.Value
Cells(FinalRow, 12).Value = UserForm1.TextBox4.Value
Cells(FinalRow, 14).Value = UserForm1.TextBox5.Value
Cells(FinalRow, 15).Value = UserForm1.TextBox6.Value
Cells(FinalRow, 16).Value = UserForm1.TextBox7.Value
Cells(FinalRow, 17).Value = UserForm1.TextBox8.Value
Cells(FinalRow, 19).Value = UserForm1.TextBox9.Value
Cells(FinalRow, 23).Value = UserForm1.TextBox10.Value
Cells(FinalRow, 22).Value = UserForm1.TextBox11.Value
Cells(FinalRow, 9).Value = CDate(UserForm1.TextBox12.Value)
Cells(FinalRow, 10).Value = CDate(UserForm1.TextBox18.Value)
Cells(FinalRow, 18).Value = UserForm1.ComboBox2.Value
Cells(FinalRow, 21).Value = UserForm1.ComboBox3.Value
Cells(FinalRow, 1).Value = UserForm1.TextBox16.Value
Cells(FinalRow, 2).Value = CDate(UserForm1.TextBox15.Value)
Cells(FinalRow, 8).Value = UserForm1.TextBox17.Value
ActiveSheet.Protect Password:="", UserInterfaceOnly:=True, DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowSorting:=True, AllowFiltering:=True
End Sub
Danke Grüße Kuni