This is an old question, but I feel this second comment is good. I would like to add a little to it to help people achieve the described answer:
- Create (ctrl + t) a table and open Formulas>Name Manager
- Select doublec-click the table in the list of names and name it
- In your userform, enter the name of the table (that you named it in 2.) in RowSource:
When you open the form you should see all the items in the table listed in the listbox:
If you add to the table you add to that listbox's list,
Here's a little code example to remove an item and reset the table size to fit:
Sub ChangeTableSize()
Dim n As Long
Dim Tbl As ListObject
Set Tbl = Sheets(8).ListObjects(9)
With Tbl
n = .DataBodyRange.Rows.Count
.DataBodyRange(20, 1).ClearContents
.Resize Range(Tbl.DataBodyRange.Resize(n, 1).Offset(-1, 0).Address)
End With
End Sub
and Here's one to add to the table:
Sub AddtoTable()
Dim n As Long
Dim Tbl As ListObject
Set Tbl = Sheets(8).ListObjects(9)
With Tbl
n = .DataBodyRange.Rows.Count
Tbl.DataBodyRange(n + 1, 1) = "New"
End With
End Sub
Hope it is found to be useful!