Help! Named Range in VBA

megnin

Active Member
Joined
Feb 27, 2002
Messages
340
How do I refer to a named range in VBA.

I have a Range named "Parts" I use for a ComboBox list.

How can I refer to the selected item by the range name or is it easier to refer to the ComboBox selection in VBA.

I want to past the item selected in the ComboBox into another sheet for a parts list.

Thanks!!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Well, it would be easier to use the

ComboBox1.Value

but, you can use

Range("MyRange")(ComboBox1.ListIndex + 1)

or

Range("MyRange").Item(ComboBox1.ListIndex + 1).Value

that's a little bit "harder"
 
Upvote 0
Thank you. Great suggestions! I'm new to this so eager to learn the basics.

Thanks again!!
 
Upvote 0
Now how do I tell what number a DropDown Box is?

I've copy & pasted them everywhere and they all say they are "DropDown14" when I select "Assign Macro". "Properties" only show whether it will print or not.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,826
Members
449,190
Latest member
rscraig11

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