Populate ActiveX Combobox with named range

bonebreaker100

New Member
Joined
Oct 16, 2021
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hi there.

I am for hours searching an solution but nothing till now. Or it is impossible or I just wasn't able to reproduce what I've sen on my workbook.

So, here it goes:

I've set a named range com a list of banks (on sheet3!) and I want to maintain that way because there is the possibility of add or remove some rows.

On Sheet1! I've a table that I want to filter based on the bank name and, for that, I've an ActiveX Combobox. The problem is not about the filter itself; is how can I define the combobox FillList = to the named range?

Obs: A solution is to select a range like A2:A25 instead of the named range, but I need a way to remove the blank spaces.

Thank you very much for the attention.
Hope someone can help me with this, I need to deliver the project next week and the app design/layout still doesn't exist.
 

Attachments

  • help_mrexcel.png
    help_mrexcel.png
    19.7 KB · Views: 23

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Assuming you have a Combobox1
And a named Range Named Bank
try this:
VBA Code:
Private Sub CommandButton1_Click()
'Modified  10/16/2021  7:10:20 PM  EDT
ComboBox1.List = Range("Bank").Value
End Sub
 
Upvote 0
Good morning

Well, I've tried and I got this error:

help_mrexcel_2.png


I've noticed that you assigned the private sub to "CommandButton1_Click()". Could you please explain why?

I can send the file if you need to understand the problem.

Thank you so much for the help.
Regards,
bonebreaker100
 
Upvote 0
Good morning

Well, I've tried and I got this error:

View attachment 49209

I've noticed that you assigned the private sub to "CommandButton1_Click()". Could you please explain why?

I can send the file if you need to understand the problem.

Thank you so much for the help.
Regards,
bonebreaker100
Well I just used Command button 1 because thats the command button I put the script in
Copy my script and put it in any button you may want just put this part in the button:
VBA Code:
'Modified  10/16/2021  7:10:20 PM  EDT
ComboBox1.List = Range("Bank").Value
 
Upvote 0
Try something like this then:
VBA Code:
Try something like this depending on where the range is:

With ComboBox1
.Clear
.List = Sheets(3).Range("Bank").Value
End With
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

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