Named Range / Combo Box Problem

damianhuerta

New Member
Joined
Aug 31, 2011
Messages
3
Hi everybody,

I am using a combo box with a named range (Colors). However, the named range has the items written as a constant array. More specifically, In the "Refers to:" box, I wrote the following:

={"white";"black"}

Now, these are the only two options of colors that I need. Notice, they do not reference to a range of cells contained in a worksheet (just to avoid putting more lists in my workbook).

When I try to use this Named Range "Colors" in the "Input Range" field of the Combo Box (the one from the Form Controls), it gives me a msg box stating an invalid reference.

Basically, I want to hardcode the Items of my list in the Named Range "Colors" to then use the list in my combo box. Suggestions??
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi everybody,

I am using a combo box with a named range (Colors). However, the named range has the items written as a constant array. More specifically, In the "Refers to:" box, I wrote the following:

={"white";"black"}

Now, these are the only two options of colors that I need. Notice, they do not reference to a range of cells contained in a worksheet (just to avoid putting more lists in my workbook).

When I try to use this Named Range "Colors" in the "Input Range" field of the Combo Box (the one from the Form Controls), it gives me a msg box stating an invalid reference.

Basically, I want to hardcode the Items of my list in the Named Range "Colors" to then use the list in my combo box. Suggestions??

damian, i think, if memory serves me correctly, that you need to specify the sheet oin which the named range resides. so say you put it on a sheet called "Sheet1", then in the input range you would put "'Sheet1'!Colors". Try it with and without the single quotes around the sheet name.
 
Upvote 0
damian, i think, if memory serves me correctly, that you need to specify the sheet oin which the named range resides. so say you put it on a sheet called "Sheet1", then in the input range you would put "'Sheet1'!Colors". Try it with and without the single quotes around the sheet name.
It's not a named range. It's an array constant.

AFAIK, the Input RANGE must be a range address or a named range address.
 
Upvote 0
It's not a named range. It's an array constant.

AFAIK, the Input RANGE must be a range address or a named range address.

Thanks TV. I read the question as how to feed the named range to the combo box and not how to create the named range using the constant array.
 
Upvote 0
You could use the named array constant/whatever but you can't set it at design time.

Something like this perhaps:
Rich (BB code):
Private Sub Worksheet_Activate()
Dim obj As Object
    Set obj = Me.Shapes("Drop Down 1").OLEFormat.Object
    obj.List = [Colors]
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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