AW: Daten in Userform übernehmen
Beni
Hallo Micha,
hier werden fünf Spalte in ListBox verknüpft, mit Spaltenüberschrift und Tabellen übergreifend.
Bei Click in ListBox wird dieser Datensatz in die TextBox geschrieben.
Gruss Beni
Private Sub UserForm_Initialize()
With Sheets("Tabelle1")
R = .Cells(65536, 1).End(xlUp).Row
ListBox1.ColumnCount = 5
ListBox1.ColumnHeads = True
ListBox1.RowSource = Sheets("Tabelle1").Range("A2:E" & R).Address(External:=True)
End With
End Sub
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
ListBox1.SetFocus
ListBox1.BoundColumn = 1
TextBox1.Value = ListBox1.Value
ListBox1.BoundColumn = 2
TextBox2.Value = ListBox1.Value
ListBox1.BoundColumn = 3
TextBox3.Value = ListBox1.Value
ListBox1.BoundColumn = 4
TextBox4.Value = ListBox1.Value
ListBox1.BoundColumn = 5
TextBox5.Value = ListBox1.Value
End Sub