combo box question

  • Thread starter Thread starter Monte0682
  • Start date Start date
M

Monte0682

I have a 2 combo boxes... filled with numbers 1 to 10. How can I do
this.

when a person selects a number from one combo box if should be
checked in another combo box if that number was selected, if it is not
selected let the person select it and dispay a message "the element
can be selected"....

so, lets say I select "2" from combo box 1. Person should not be
allowed to select "2" from combo box 2. When a person select "3" from
combo box 2, a message should pop up.
 
What kind of ComboBox? From the Forms toolbar, Control Toolbox
toolbar, or Toolbox for UserForms?

Merjet
 
Private Sub ComboBox2_Change()
If ComboBox1 = ComboBox2 Then
MsgBox "You selected this number in ComboBox1. Select a different
number here."
ComboBox2.ListIndex = -1
Else
If ComboBox2.ListIndex > -1 Then MsgBox "Supply msg."
End If
End Sub

Maybe you want similar code behind ComboBox1, since a user could
select the same number in both by selecting from ComboBox2 first.

Hth,
Merjet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top