View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default 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