Populate Userform Comobox List With A Named Range

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have this code:
Code:
    ActiveWorkbook.Names.Add Name:="nr_funct", RefersTo:=nr_func
    permit.cbx_func.Enabled = True
    permit.cbx_func.List = range("nr_funct")

I'm not finding any luck in figuring out how to apply the contents of named range "nr_funct" as the selection list for my userform's combobox 'cbx_func'.

Its likely a very basic error I'm overlooking, but I'm stumped. All help is appreciated!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
cbx_func.RowSource = "nr_funct".
If your named range contains multiple columns, you will need to set a few properties of you combo box such as ColumnCount and perhaps ColumnWidths.

This works as well.
cbx_func.List = Application.Transpose(Application.Transpose(Range("nr_funct")))
 
Upvote 0
You need to use .Value when assigning the range to a list
VBA Code:
permit.cbx_func.List = range("nr_funct").Value
 
Upvote 0
You need to use .Value when assigning the range to a list

I did not know that. Isn't Value the default property of a range? I wonder why you have to add it. Nevertheless, it works. Thanks! :)
 
Upvote 0
Thank you both for coming to my help.
Dataluver, just a simple range of one columns worth of data. I think I have all the properties set up as needed.
Thank you Fluff. I was hoping it would be that easy. That's likely why my Google searches ended up empty.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

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