von Listbox in Textbox kopieren
hallo,
ich habe eine Listbox mit 7 spalten
wenn ich auf eins der datensätze klicke, würde ich gerne dass der ausgewählte datensatz in die textboxe 1 bis 7 übertragen wird.
scheitere momentan an folgender stelle..
For i = 1 To 7
boxnummer = 30 + i
UserForm1.Controls(TextBox & boxnummer).Text = UserForm1.ListBox2.List(iRow, i).Text
Next i
vielen Dank für die unterstützung
Antwort schreiben
Antwort 1 von Hajo_Zi vom 15.10.2021, 12:20 Options
Hallo,
Private Sub ListBox1_Change()
If ListBox1.Tag <> "" Then Exit Sub
TextBox1 = ListBox1.List(ListBox1.ListIndex, 0)
TextBox2 = ListBox1.List(ListBox1.ListIndex, 1)
TextBox3 = ListBox1.List(ListBox1.ListIndex, 2)
TextBox4 = ListBox1.List(ListBox1.ListIndex, 3)
TextBox5 = ListBox1.List(ListBox1.ListIndex, 4)
TextBox6 = ListBox1.List(ListBox1.ListIndex, 5)
TextBox7 = ListBox1.List(ListBox1.ListIndex, 6)
End Sub
Gruß Hajo