Pull information from selected row via listbox
Good morning all,
I once again could use your assistance with something.
So I am trying to build a 'briefing generator' and I am missing a piece of the puzzle.
I am using the following code to pull our incident codes from a column in a table, into a listbox.
I need to be able to populate textbox fields with the information found on the row which corresponds with the selection found in the listbox.
So if column 1 is populating the listbox, I need column 2, 3 and 4 to populate the textboxes with the row address within the listbox selection.
http://www.vbaexpress.com/forum/imag...AAAElFTkSuQmCC
Code:
Private Sub CommandButton2_Click()
UserForm1.Show
Dim tbl As ListObject
Dim rng As Range
Set tbl = ActiveSheet.ListObjects("Table6")
Set rng = tbl.ListColumns(1).DataBodyRange
Dim cl As Range
For Each cl In rng
UserForm1.ListBox1.AddItem (cl.Value)
Next
End Sub
Any help you could provide on this would be extremely helpful.
Many thanks in advance.