Ich habe eine Userform mit 8 Textboxen
nun möchte ich das in Tabelle 1 alle 8 Textboxen in der letzten freien Zeile eingetragen werden und in Tabelle 2 nur 2 Textboxen auch in der letzten freien Zeile
vielen Dank im voraus für eure Hilfe
Private Sub CommandButton1_Click()
Dim i As Integer
Dim lngZiel As Long
With Sheets("Tabelle1")
lngZiel = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
For i = 1 To 8
.Cells(lngZiel, i).Value = Controls("Textbox" & i).Value
Next
End With
With Sheets("Tabelle2")
lngZiel = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
For i = 1 To 2
.Cells(lngZiel, i).Value = Controls("Textbox" & i).Value
Next
End With
End Sub
MfG TomPrivate Sub CommandButton1_Click()
Dim i As Integer
Dim lngZiel As Long
With Sheets("Tabelle1")
lngZiel = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
For i = 1 To 8
.Cells(lngZiel, i).Value = Controls("Textbox" & i).Value
Next
End With
With Sheets("Tabelle2")
lngZiel = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(lngZiel, 1).Value = TextBox4.Value
.Cells(lngZiel, 2).Value = TextBox7.Value
End With
End Sub
MfG TomFor i = 1 To 2
For i = 2 To 3
Private Sub CommandButton1_Click()
Dim i As Integer
Dim lngZiel As Long
Application.ScreenUpdating = False
With Sheets("Tabelle1")
lngZiel = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
For i = 1 To 8
.Cells(lngZiel, i).Value = Controls("Textbox" & i).Value
Next
End With
With Sheets("Tabelle2")
lngZiel = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(lngZiel, 1).Value = TextBox4.Value
.Cells(lngZiel, 2).Value = TextBox7.Value
End With
Application.ScreenUpdating = True
End Sub
Gruß WernerApplication.ScreenUpdating = False 'Bildschirmaktualisierung ausschalten
Application.Calculation = xlCalculationManual 'automat.Berechnung ausschalten
'***weiterer Code***
Application.Calculation = xlCalculationAutomatic 'automat.Berechnung einschalten
Application.ScreenUpdating = True 'Bildschirmaktualisierung einschalten
Gruß Werner