View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Matthew Herbert[_3_] Matthew Herbert[_3_] is offline
external usenet poster
 
Posts: 149
Default 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