Combobox programming

  • Thread starter Thread starter Christian Reusch
  • Start date Start date
C

Christian Reusch

Hi,

I want to do the following:

Table 1 (Configuration):

project1
action1
action2
action3

project2
action6
action7
action8


Table 2:

I want to have two comboboxes. The first should be used to choose one
of the projects. If a project is chosen, the actions of this project
should be in a second combobox.

Is this possible??

Thanks, Christian
 
Hi Christian
Make the ListFillRange for combobox 1 reflect the cells containing the
project names then use the following code to select the ListFillRange for
combobox2 depending on the selection in box1

Private Sub ComboBox1_Change()
If ComboBox1.Text = "project 1" Then
ComboBox2.ListFillRange = "j1:j3"
ComboBox2.Text = ""
Else
If ComboBox1.Text = "project 2" Then
ComboBox2.ListFillRange = "k1:k3"
ComboBox2.Text = ""
Else: ComboBox2.Text = "Select project first"
End If
End If
End Sub

Hope this helps

Ian
 
Christian,

I have a workbook example of how to achieve this sort of dependent combobox.

Mail me if you want a copy.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top