Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for combobox
I am struggling to write code that allows the user to progressively
select a value from a list. For example from a long list the user could type R to show all the items starting with R, then type o, to reduce the list to all items starting with Ro etc. Secondly if the user types a term that is not on the list, it should be added to the list for future selection. As I see it this is the primary purpose of a combo-box but I cant find the above code. Any help will be appreciated. Thanks, Rod |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for combobox
REM,
How do you plan on loading your ComboBox? My initial thoughts are that you can create the combo box list in a worksheet (which you could make hidden or very hidden) to store the values for the combo box. It's likely that you can then use the ListIndex property to test whether the item is in the combo box or not. (A value of -1 means that the item is not in the list). If the item isn't in the list, you can append it to your combo box list on the aforementioned worksheet. If you choose to add the items in the combo box via a worksheet, then you can utilize the RowSource property to load the items quite quickly; otherwise, you'll need to use the AddItem method. I hope this is enough to get you started. Best, Matthew Herbert "REM" wrote: I am struggling to write code that allows the user to progressively select a value from a list. For example from a long list the user could type R to show all the items starting with R, then type o, to reduce the list to all items starting with Ro etc. Secondly if the user types a term that is not on the list, it should be added to the list for future selection. As I see it this is the primary purpose of a combo-box but I cant find the above code. Any help will be appreciated. Thanks, Rod |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code for combobox
you could do this with a userform. I like to use 2 list boxes and an edit box
one list box should hold all the data and should have visible = false The text box is the filter. each time a character is typed to the exit box, the listbox is filtered and results placed into the 2nd listbox. Works well and can easily be adapted for adding values if they don't exist. If this is atill an issue, I can let you have a demo spreadsheet. "REM" wrote: I am struggling to write code that allows the user to progressively select a value from a list. For example from a long list the user could type R to show all the items starting with R, then type o, to reduce the list to all items starting with Ro etc. Secondly if the user types a term that is not on the list, it should be added to the list for future selection. As I see it this is the primary purpose of a combo-box but I cant find the above code. Any help will be appreciated. Thanks, Rod |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
combobox code | Excel Discussion (Misc queries) | |||
combobox code | Excel Discussion (Misc queries) | |||
combobox code | Excel Discussion (Misc queries) | |||
Code for ComboBox | Excel Programming | |||
Code for ComboBox | Excel Programming |