ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   combo box question (https://www.excelbanter.com/excel-programming/386801-combo-box-question.html)

Monte0682

combo box question
 
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.


merjet

combo box question
 
What kind of ComboBox? From the Forms toolbar, Control Toolbox
toolbar, or Toolbox for UserForms?

Merjet



Monte0682

combo box question
 
On Apr 3, 2:58 pm, "merjet" wrote:
What kind of ComboBox? From the Forms toolbar, Control Toolbox
toolbar, or Toolbox for UserForms?

Merjet


toolbox for userforms


Monte0682

combo box question
 
Toolbox for UserForms


merjet

combo box question
 
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




All times are GMT +1. The time now is 01:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com