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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Juan Pablo González

MrExcel MVP
Joined
Feb 8, 2002
Messages
11,959
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"
 

megnin

Active Member
Joined
Feb 27, 2002
Messages
340
Thank you. Great suggestions! I'm new to this so eager to learn the basics.

Thanks again!!
 

megnin

Active Member
Joined
Feb 27, 2002
Messages
340
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!
 

Forum statistics

Threads
1,181,461
Messages
5,930,071
Members
436,718
Latest member
messa57fr

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
Top