VB and combo box

  • Thread starter Thread starter eleftheriak
  • Start date Start date
E

eleftheriak

hello,

I have created a combo box using VB and I would like to assign a
different numerical value for every item in the list. So, what item is
selected the value appears in a shell. For example, for ice cream value
when it is clicked I want the value 3 appeared in cell A1 Can anyone
help?

Thanks in advance

Riri
 
Hi Riri,
I have created a combo box using VB and I would like to assign a
different numerical value for every item in the list. So, what item is
selected the value appears in a shell. For example, for ice cream
value when it is clicked I want the value 3 appeared in cell A1 Can
anyone help?

There are a few different ways to do this. Here's one that requires no VBA
coding to accomplish:

1) set up your range of products in, let's say, A1:B3 as follows:

1 ice cream
2 cake
3 pizza

2) set the following properties of the ComboBox:

BoundColumn = 1
ColumnCount = 2
ColumnWidths = 0 pt
LinkedCell = Sheet1!A5
ListFillRange = Sheet1!A1:B3

Now, when the user selects an item in the dropdown, the cell A5 will reflect
the ID of the product selected.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
Hi Riri,
Where can you put the properties?

That depends on where the control is. If you have it on a Worksheet, then
you can go to design view (click the protractor-looking icon), right-click
the combobox, and select Properties. When you're done, just click the
design mode button to exit design mode. If the control is on a userform,
you can modify the properties by selecting the combobox and changing the
values in the properties window. If it's not visible, hit F4 to display it.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top