#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default comboboxes

I have 5 comboboxes each has numbers 1 to 5

If combobox1 has 1 then the remaining boxes dropdown menu cannot show 1 and
so on.

There is no order in which the combobxes will be selected.

For eg: Combobox1 has been filled first with say option 4.
next I decide to fill combobox 4. The drop down menu for this should show on
1, 2, 3,5.

Is this possible.

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default comboboxes

Try the below code behind the userform after placing 5 comboboxes in your
userform.


Private Sub ComboBox1_DropButtonClick()
Fillcombo
End Sub
Private Sub ComboBox2_DropButtonClick()
Fillcombo
End Sub
Private Sub ComboBox3_DropButtonClick()
Fillcombo
End Sub
Private Sub ComboBox4_DropButtonClick()
Fillcombo
End Sub
Private Sub ComboBox5_DropButtonClick()
Fillcombo
End Sub

Sub Fillcombo()
Dim blnFound As Boolean, strTemp As String

strTemp = Me.ActiveControl.Object.Text
Me.ActiveControl.Object.Clear
Me.ActiveControl.Object.Text = strTemp
For intTemp = 1 To 5
blnFound = False
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSForms.ComboBox Then
If Me.ActiveControl.Name < ctrl.Name Then
If ctrl.Text = CStr(intTemp) Then blnFound = True: Exit For
End If
End If
Next ctrl
If blnFound = False Then _
Me.ActiveControl.Object.AddItem intTemp
Next
End Sub



If this post helps click Yes
---------------
Jacob Skaria


"aqualibra" wrote:

I have 5 comboboxes each has numbers 1 to 5

If combobox1 has 1 then the remaining boxes dropdown menu cannot show 1 and
so on.

There is no order in which the combobxes will be selected.

For eg: Combobox1 has been filled first with say option 4.
next I decide to fill combobox 4. The drop down menu for this should show on
1, 2, 3,5.

Is this possible.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default comboboxes

Do you have a method for the user to clear all the TextBoxes so he/she can
start over (for example, if they click the wrong entry in a ComboBox by
mistake)?

--
Rick (MVP - Excel)


"aqualibra" wrote in message
...
I have 5 comboboxes each has numbers 1 to 5

If combobox1 has 1 then the remaining boxes dropdown menu cannot show 1
and
so on.

There is no order in which the combobxes will be selected.

For eg: Combobox1 has been filled first with say option 4.
next I decide to fill combobox 4. The drop down menu for this should show
on
1, 2, 3,5.

Is this possible.

Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ComboBoxes in VBA Ronald Dodge[_2_] Excel Programming 4 July 25th 07 01:24 AM
COMBOBOXES Zigball Excel Programming 1 December 19th 06 01:10 AM
ComboBoxes Ryan Excel Programming 0 April 14th 04 10:56 PM
Comboboxes Angeliki Excel Programming 1 March 3rd 04 12:00 PM
Comboboxes David W[_3_] Excel Programming 1 August 29th 03 11:13 PM


All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"