LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Adding the same content to multiple combo boxes

Chip, Tom.. thanks for your help, it worked great.
the second part was to have an item be removed from all
the other combo boxes once it was selected from another
one. this was complicated byt he fact that there was no
way to know in what order the comboboxes would be used.

This is how i ended up doing it... basically storing the
list index of the selection into a variable, then making
sure that the other comboboxes didnt have count of zero
(since i clear the combobox list after a choice is made),
then removing the corresponding list index. This is for
the first box, the other five are exactly the same, with
the exception of combobox referances of corse:

Private Sub StatBox1_Click()
' Lockes the stat choice in, and removes it
' from the other comboboxes
Dim strStat As String
Dim X As Integer
X = Me.StatBox1.ListIndex
'MsgBox X
strStat = Me.StatBox1.Value
Me.StatBox1.Clear
Me.StatBox1.Value = strStat
Me.StatBox1.Locked = True

Call FindStat(Me.StatBox1.Value, Me.stat1.Value)

If (Me.StatBox2.ListCount 0) Then
Me.StatBox2.RemoveItem (X)
End If
If (Me.StatBox3.ListCount 0) Then
Me.StatBox3.RemoveItem (X)
End If
If (Me.StatBox4.ListCount 0) Then
Me.StatBox4.RemoveItem (X)
End If
If (Me.StatBox5.ListCount 0) Then
Me.StatBox5.RemoveItem (X)
End If
If (Me.StatBox6.ListCount 0) Then
Me.StatBox6.RemoveItem (X)
End If
End Sub

 
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
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
multiple combo boxes jeff Excel Discussion (Misc queries) 2 December 16th 08 05:02 PM
Multiple combo boxes with unique duplicates showing only Nemo New Users to Excel 0 July 6th 07 03:20 PM
Problem Adding new Combo Boxes [email protected] Excel Discussion (Misc queries) 2 September 12th 06 09:58 AM
multiple combo boxes LilyDog7 Excel Discussion (Misc queries) 4 October 17th 05 10:22 PM


All times are GMT +1. The time now is 03:06 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"