when I transfer the row, the error wrong data type or user-defined data type is always displayed even though the cell is defined as a date. So apparently not the date but a string is transmitted. How can I pass the string txtEnd as a date. I tried it, but it didn't work.
Thank you for your help.
Best regards
Private Sub CommandButton1_Click()
Dim iRow As Long
iRow = Tabelle1.Range("C" & Rows.Count).End(xlUp).Row + 1
With Tabelle1
.Range("C" & iRow).Value = Me.txtTask.Value
.Range("D" & iRow).Value = Me.txtDescription.Value
.Range("E" & iRow).Value = "important"
.Range("F" & iRow).Value = "open"
.Range("G" & iRow).Value = "not started"
.Range("H" & iRow).Value = "not started"
.Range("I" & iRow).Value = Me.txtBegin.Value
.Range("J" & iRow).Value = Me.txtEnd.Value
.Range("K" & iRow).Value = "0 %"
End With
With Me
For Each ctl In .Controls
If TypeName(ctl) = "TextBox" Then
ctl.Value = vbNullString
End If
Next
End With
End Sub
Private Sub txtEnd_AfterUpdate()
On Error Resume Next
Me.txtEnd = CDate(Me.txtEnd)
End Sub