mit diesem makro überttrage ich den inhalt einer userform in eine tabelle.
Jetzt möchte ich das mit der txtbox 86 automatisch das aktuelle datum üertragen wird,wenn die zelle leer ist.
bekomme es leider ohne eure hilfe nicht hin.
gruß rolf
Private Sub btn_eintragen_Click()
Dim ctl As Control
Dim wohin As Integer
wohin = Sheets("Liste").Range("B8000").End(xlUp).Offset(1, 0).Row
wohin = Me.ListBox1.ListIndex + 1
With Sheets("Abstammungen")
On Error Resume Next
.Cells(wohin, 1) = Format(TextBox1.Text)
.Cells(wohin, 2) = Format(TextBox32.Text)
.Cells(wohin, 3) = Format(TextBox3.Text)
.Cells(wohin, 4) = Format(TextBox4.Text)
.Cells(wohin, 5) = CDate(TextBox45.Text)
Cells(wohin, 130) =
(TextBox86.Text) ?
Cells.Select
With Selection
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("F2").Select
End With
ListBox1.SetFocus
End Sub