Es werden mittels folgendem Code Daten aus einer UF heraus in eine Tabelle gteschrieben!
Dim lng As Long
Dim i As Integer
With frmAnsetzungen
Sheets("1. Liga").Activate
For lng = 3 To ActiveSheet.UsedRange.Rows.Count
If Cells(lng, 53).Value = .TextBox3.Value Then
If Cells(lng, 53).Value = .TextBox4.Value Then
Cells(lng, 54).Value = CDate(TextBox13)
Cells(lng, 55).Value = .TextBox22.Text
Cells(lng, 56).Value = CDate(TextBox31)
End If
TextBox13 = Format(TextBox13, "dd.mm.yyyy")
TextBox22 = Format(TextBox22, "ddd")
TextBox31 = Format(TextBox31, "hh:mm")
If Cells(lng, 53).Value = .TextBox5.Value Then
Cells(lng, 54).Value = CDate(TextBox14)
Cells(lng, 55).Value = .TextBox23.Text
Cells(lng, 56).Value = CDate(TextBox32)
End If
TextBox14 = Format(TextBox14, "dd.mm.yyyy")
TextBox23 = Format(TextBox23, "ddd")
TextBox32 = Format(TextBox32, "hh:mm")
If Cells(lng, 53).Value = .TextBox6.Value Then
Cells(lng, 54).Value = CDate(TextBox15)
Cells(lng, 55).Value = .TextBox24.Text
Cells(lng, 56).Value = CDate(TextBox33)
End If
TextBox15 = Format(TextBox15, "dd.mm.yyyy")
TextBox24 = Format(TextBox24, "ddd")
TextBox33 = Format(TextBox33, "hh:mm")
If Cells(lng, 53).Value = .TextBox7.Value Then
Cells(lng, 54).Value = CDate(TextBox16)
Cells(lng, 55).Value = .TextBox25.Text
Cells(lng, 56).Value = CDate(TextBox34)
End If
TextBox16 = Format(TextBox16, "dd.mm.yyyy")
TextBox25 = Format(TextBox25, "ddd")
TextBox34 = Format(TextBox34, "hh:mm")
Nun mein Problem: Wenn nun in einer oder mehreren TextBoxen, wo eigentlich vorgesehen, kein Datum steht kommt die Fehlermeldung - "Typen unverträglich".
Könnt ihr mir weiterhelfen, so dass auch der Code läuft wenn nicht überall ein Datum steht. Die Abfrage für eine TextBox dürfte reichen, den Rest passe ich ggf. an!!! Vielen Dank!!!
Gruß Frank H.!!!