View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Populating a combo box at run time

Private Sub combobox1_Click()

' code that populates comobobox2

Combobox2.Listindex = 1
End sub

--
Regards,
Tom Ogilvy


"Graham Whitehead" wrote:

Hi, I have a couple of comboboxes - the contents of the second are dependent
on the selection in the first one. I have this part running fine. the
problem I am having is that when a new option is selected in the first combo
box the contents of the second combobox do not change until the
dropbuttonclick even.

To make things clear here is the order of operations:

user clicks the drop down arrow on combobox 1 user then makes a selection
from combobox 1 this calls the code to populate the second combobox
dependant on what user has selected THIS IS WHERE THE PROBLEM IS -
basically i want the first option of the new list to be automatically
displayed in the combobox now - however, the old value is left there until
the user clicks the drop down arrow.

Hope this makes sense. Can anyone help me out?

thanks for reading this.