Dynamic Ranges With Active X Combo Boxes

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
251
Office Version
  1. 365
Platform
  1. Windows
I have an Active X Combo Box and I want the list reference to be dynamic, but it won't allow tables for the ListFillRange. Is there a way to have a dynamic list without using a named range that exceeds the existing list that allows for additions, but generates a lot of blanks at the bottom?
 
Table1, Table2
Yes
Yes

See attached images
 

Attachments

  • Tables.png
    Tables.png
    29.5 KB · Views: 11
  • Code.png
    Code.png
    74.4 KB · Views: 12
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Let's see if you can get the code working in a NEW workbook (which is what I am doing) and then we will try to work out what is different in your live workbook

We are both using Excel365 ... so what works for me should work for you ?

ActiveX Combo.jpg

Tables.jpg


1 Rename sheet1 as "Data"
2 Add your values and create your 2 Tables (will be autonamed Table1 and Table2)
3 Insert a new sheet and on that sheet insert 2 active-x comboboxes (will be autonamed ComboBox1 and ComboBox2)
4 Paste code below into 2nd sheet's code window
5 Test by clicking on the drop button
6 That should work
7 Tell me how you get on

VBA Code:
Private Sub ComboBox1_DropButtonClick()
Me.ComboBox1.List = Sheets("Data").ListObjects("Table1").ListColumns(1).DataBodyRange.Value
End Sub

Private Sub ComboBox2_DropButtonClick()
Me.ComboBox2.List = Sheets("Data").ListObjects("Table2").ListColumns(1).DataBodyRange.Value
End Sub
 
Upvote 0
I created a new workbook and followed your instructions and it worked perfectly. I went back to my current workbook, deleted all the current combo boxes and tables, rebuilt them and now all works perfectly. Not sure what happened, but thank you so much for your help!
 
Upvote 0
Yes - Excel works in mysterious ways at times ;)
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top