![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 182
|
I have made a combobox which lists wards which medication is to be sent to. I need to know how:
when the user clicks on one of the 10 ward which drop down from the combo box, this then appears in another cell. So far i can only manage (using the help) to get it to return a number which relates to the position in the drop down list which is clicked. i need it to return the text (ward) which is clicked on. I'm sorry if this isn't clear but i'm a bit new to control buttons and macros and stuff. i'd really appreciate some help jamie |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Where the wild roses grow
Posts: 285
|
OK, say you want it in Cell A1, you'd need to put put this in your Combobox event: Worksheets("sheetwhatever").range("a1").value = combobox1 Hope this helps |
|
|
|
|
|
#3 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Jamie
I have an example here that would be helpful. It has the formula you need to return the text from the ComboBox, among other things. http://www.ozgrid.com/download/default.htm Down the very bottom is: ChangingCombo2.zip Download it. |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
If you're using a Form toolbar ComboBox use the Linked cell to get the "row" number of the selection, then use the INDEX function to retrieve the "actual" selected text. Something like
=INDEX(ComboBoxFillRange,LinkedCell) |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|