Hello
In UserForm I have a ListBox, I would like that ListBox’s data source were coming from separate spreadsheet called “test” Address to this spreadsheet would be kept in cell A2 of “data” spreadsheet where ListBox is created on. In addition I need user to be able to double click on UserForm row in order to see message box with value from 1st cell of it. Screenshots of desired outcome below.
Hope you can help!
In UserForm I have a ListBox, I would like that ListBox’s data source were coming from separate spreadsheet called “test” Address to this spreadsheet would be kept in cell A2 of “data” spreadsheet where ListBox is created on. In addition I need user to be able to double click on UserForm row in order to see message box with value from 1st cell of it. Screenshots of desired outcome below.
Code:
Dim SourceWB As WorkbookDim ListItems As Variant
Application.ScreenUpdating = False
Set SourceWB = Workbooks.Open(Sheets("data").Range("A2"), False, True)
ListItems = SourceWB.Worksheets(2).Range("B1:AM3")
' here I am collecting data directly from the range, I would like it to be fetched from the table named "Table2"
With Me.ListBox1
.List = ListItems
.ColumnCount = 5
End With
SourceWB.Close False
Set SourceWB = Nothing
Application.ScreenUpdating = True