Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I have a Userform with 5 ComboBoxes names "ComboBox1" to "ComboBox5". Each of them is loaded with the same data base. When I make a choice in a Combo, I have to control the entry. How can I make a routine to know which of the five has been selected and to get the selection. I tried to use a Class Module but unsuccesfully: Exit method doesn't operate. Thanks for helping me. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a Userform with 5 ComboBoxes names "ComboBox1" to "ComboBox5".
How can I make a routine to know which of the five has been selected and to get the selection. This should get you started. If c.ListIndex = -1, the ComboBox hasn't been selected. If the ComboBox has been selected, then c.Value will show the value. HTH, Merjet Private Sub UserForm_Click() Dim c As Control For Each c In Me.Controls If TypeName(c) = "ComboBox" Then MsgBox c.Name & " " & c.ListIndex & " " & c.Value End If Next c End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Merjet, thanks for your answer
Your proposal is right, but I don't use the Userform_Click event. I only skip from one ComboBox to an other. My problem is to find which ComboBox has just been used to verify if the selection is got from the data base or is a new element. I must do that each time I leave a ComboBox. Regards Michel "merjet" a écrit dans le message news: 7eEeb.646593$YN5.496747@sccrnsc01... I have a Userform with 5 ComboBoxes names "ComboBox1" to "ComboBox5". How can I make a routine to know which of the five has been selected and to get the selection. This should get you started. If c.ListIndex = -1, the ComboBox hasn't been selected. If the ComboBox has been selected, then c.Value will show the value. HTH, Merjet Private Sub UserForm_Click() Dim c As Control For Each c In Me.Controls If TypeName(c) = "ComboBox" Then MsgBox c.Name & " " & c.ListIndex & " " & c.Value End If Next c End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your proposal is right, but I don't use the Userform_Click event. I only
skip from one ComboBox to an other. My problem is to find which ComboBox has just been used to verify if the selection is got from the data base or is a new element. I must do that each time I leave a ComboBox. Then move the code (w/o 1st & last lines) to another procedure where you do want it. HTH, Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
comboboxes | Excel Discussion (Misc queries) | |||
Comboboxes | New Users to Excel | |||
Need help with ComboBoxes. | New Users to Excel | |||
ComboBoxes and Formulas | Excel Programming | |||
Comboboxes | Excel Programming |