Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
dynamically lengthened combobox
this one is a bit complicated. so i have a form with a combobox and two textboxes. the combobox is, by default, filled with the string "Ingredient 1" in the first line. what i would like to do with this is to have the user input text into either or both of the two text boxes, and when the user clicks the combobox again, another row in the combobox, "Ingredient 2" is added so that the user can input text into the textboxes for that ingredient. the trick is, i would like to make it so that when the user returns to ingredient 1 or 2 or so on, the text they entered for those ingredients is filled back into the text box. my only problem is i can't seem to find the method/properties that allow changes on the selection of an item in a combobox. the rest i think i can do. any help is appreciated, sven. -- medicenpringles ------------------------------------------------------------------------ medicenpringles's Profile: http://www.excelforum.com/member.php...o&userid=16458 View this thread: http://www.excelforum.com/showthread...hreadid=492456 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
dynamically lengthened combobox
The items in a combobox can be read using the listindex which starts at 0 to
n-1 for each item n in the list. A value of -1 is returned if there is no selection. You can use this value to index your sheet list. Use the change event for the combobox to determine the listindex value e.g...... Private Sub ComboBox1_Change() If combobox_1.ListIndex -1 Then ' run your code to update the textboxes based on the valid listindex End If End Sub -- Cheers Nigel "medicenpringles" <medicenpringles.1zud4m_1134247202.3786@excelfor um-nospam.com wrote in message news:medicenpringles.1zud4m_1134247202.3786@excelf orum-nospam.com... this one is a bit complicated. so i have a form with a combobox and two textboxes. the combobox is, by default, filled with the string "Ingredient 1" in the first line. what i would like to do with this is to have the user input text into either or both of the two text boxes, and when the user clicks the combobox again, another row in the combobox, "Ingredient 2" is added so that the user can input text into the textboxes for that ingredient. the trick is, i would like to make it so that when the user returns to ingredient 1 or 2 or so on, the text they entered for those ingredients is filled back into the text box. my only problem is i can't seem to find the method/properties that allow changes on the selection of an item in a combobox. the rest i think i can do. any help is appreciated, sven. -- medicenpringles ------------------------------------------------------------------------ medicenpringles's Profile: http://www.excelforum.com/member.php...o&userid=16458 View this thread: http://www.excelforum.com/showthread...hreadid=492456 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
creating a combobox dynamically on an excel sheet | New Users to Excel | |||
No replies, so again : How to add Combobox to cell dynamically? | Excel Programming | |||
How to add a Combobox dynamically based on contents of some other cell? | Excel Programming | |||
Dynamically adding data to a Combobox? | Excel Programming | |||
Program a combobox/dropdownlist to create textboxes dynamically | Excel Programming |