Diving_Dan
Board Regular
- Joined
- Oct 20, 2019
- Messages
- 161
Hi all,
I am struggling to get a listbox working. I have created it on a worksheet and wish for it tp be populated by data from a table on another worksheet within the same workbook. I have tried using the below code but it doesn't seem to work. I'm not sure if i'f i'm putting it in the wrong place or what i'm doing wrong. Any help is always greatly appreciated.
Stay safe all
I am struggling to get a listbox working. I have created it on a worksheet and wish for it tp be populated by data from a table on another worksheet within the same workbook. I have tried using the below code but it doesn't seem to work. I'm not sure if i'f i'm putting it in the wrong place or what i'm doing wrong. Any help is always greatly appreciated.
Stay safe all
VBA Code:
Dim tbl As ListObject
Dim cell As Range
'Store Table Object to a variable
Set tbl = Sheet6.ListObjects("Table1")
'Load List Box
For Each cell In tbl.DataBodyRange.Columns(6).Cells
ListBox1.AddItem cell.Value
Next cell