Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



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
creating a combobox dynamically on an excel sheet gupt New Users to Excel 8 June 7th 05 04:07 AM
No replies, so again : How to add Combobox to cell dynamically? Abhinav[_3_] Excel Programming 2 May 17th 04 05:14 AM
How to add a Combobox dynamically based on contents of some other cell? Abhinav[_2_] Excel Programming 1 May 13th 04 11:00 AM
Dynamically adding data to a Combobox? samanathon Excel Programming 4 April 5th 04 11:26 AM
Program a combobox/dropdownlist to create textboxes dynamically ed Excel Programming 0 October 30th 03 09:02 PM


All times are GMT +1. The time now is 09:21 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"