Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VB and combo box

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default VB and combo box

Hi Riri,

Riri wrote:
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]

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default VB and combo box




Where can you put the properties?


Thanks

Riri

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default VB and combo box

Hi Riri,

Riri wrote:
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]

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
linking a form combo box... results from the combo box to another Trey Excel Discussion (Misc queries) 1 July 15th 07 01:58 AM
combo reference on another combo box for picking address etc. kbjin Excel Worksheet Functions 1 December 8th 06 03:29 PM
In Excel I need to set up a combo box based on another combo box. donna_ge Excel Discussion (Misc queries) 2 March 29th 06 03:26 PM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 1 February 16th 05 02:05 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 0 February 15th 05 07:45 PM


All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"