Search code examples
vbaexcelcontrols

Use table column for ListFillRange on Combo and List Boxes


I've been trying to get a ComboBox to use the first column of a table as its range input but it seems to just do nothing.

ex.

sheet1.ComboBox1.ListFillRange = "table1"
sheet1.ComboBox1.ListFillRange = "table1[Column 1]"

Both don't work. Even when using a form ComboBox instead of activeX one and putting 'table1' or 'table1[Column 1]' as the input range. I've also tried adding an '=' at the beginning of the string ("=table1", etc.).

Then I decided to name the table range since other named ranges work when using .ListFillRange:

sheet1.ComboBox1.ListFillRange = "RangeName"

which also doesn't work (I assume because the named range is just a reference to the same thing that I originally tried).

So do I just have to make a normal formula to find the range that the first column is in or am I missing something? (This really seems like it should be a feature since it's so simple but I guess nothing is ever as straightforward as we'd like it)


Solution

  • sheet1.ComboBox1.ListFillRange = Range(“table1”).Columns(1).Address