MrExcel Publishing
Your One Stop for Excel Tips & Solutions

how can i find that what is the current selection at my combobox.


Posted by Adnan Badar on February 10, 2002 11:36 PM

how can i find that what is the current selection at my combobox.

for example my combobox have theses items
1) adnan
2) badar
3) kashif
4) noman e.t.c.

then for example some body select kashif from the list of combobox then how can i put the current value(kashif) in a string.

to use that string in any place in my sheet.


Posted by Aladin Akyurek on February 11, 2002 1:01 AM

If you used Form from Toolbars to set up the ComboBox, you must have given an Input range that houses the names you mention and a Cell link in order to anchor the ComboBox to a cell.

If the above is correct, the following formula will give you the item that is selected from the ComboBox:

=INDEX(input-range,cell-link)

Replace the args of INDEX with the corresponding references.

Posted by Adnan Badar on February 11, 2002 9:30 PM

but if i put my combo in a sheet rather than on a form then?
i'll be ok?

Posted by Aladin Akyurek on February 12, 2002 9:17 AM

Adnan: I meant Forms (not Form) under View|Toolbars. This allows you to set up a ComboBox in a worksheet. If set up this way, you can't pull off directlt what is selected by the user. You need to use the INDEX formula to access the selection made. I'm on a Mac so I can't check this: There is another route for setting up a ComboBox (in Excel on Windows) which can be directly referenced in order to get the selection made.

Aladin