AW: Daten aus aktiver Zeile in UserForm
12.10.2022 14:56:38
Nepumuk
Hallo Dieter,
würden die TextBoxen in derselben Reihenfolge stehen wie die Spalten, dann wäre es ein Dreizeiler.
Option Explicit
Private Sub CmBSpeichern_Click()
Cells(Selection.Row, 2).Value = TextBox1.Text
Cells(Selection.Row, 3).Value = TextBox4.Text
Cells(Selection.Row, 4).Value = TextBox3.Text
Cells(Selection.Row, 5).Value = TextBox2.Text
Cells(Selection.Row, 6).Value = TextBox11.Text
Cells(Selection.Row, 7).Value = TextBox6.Text
Cells(Selection.Row, 8).Value = TextBox7.Text
Cells(Selection.Row, 9).Value = TextBox10.Text
Cells(Selection.Row, 10).Value = TextBox8.Text
Cells(Selection.Row, 11).Value = TextBox9.Text
Cells(Selection.Row, 11).Value = Date
End Sub
Private Sub UserForm_Initialize()
TextBox1.Text = Cells(Selection.Row, 2).Text
TextBox4.Text = Cells(Selection.Row, 3).Text
TextBox3.Text = Cells(Selection.Row, 4).Text
TextBox2.Text = Cells(Selection.Row, 5).Text
TextBox11.Text = Cells(Selection.Row, 6).Text
TextBox6.Text = Cells(Selection.Row, 7).Text
TextBox7.Text = Cells(Selection.Row, 8).Text
TextBox10.Text = Cells(Selection.Row, 9).Text
TextBox8.Text = Cells(Selection.Row, 10).Text
TextBox9.Text = Cells(Selection.Row, 11).Text
End Sub
Gruß
Nepumuk