View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
crazybass2 crazybass2 is offline
external usenet poster
 
Posts: 167
Default ComboBox Row Source across ALL sheets

Corey,

The code I sent you should give a message box after you make a selection in
Combobox4 (converyor). Are you looking for the same format as the Excel Find
All?

Mike

"Corey" wrote:


Mike,
Thanks again for the time to reply.
It works SPOT ON, exactly as i need.
It narrows down the 2nd ComboBox to display ONLY values that are on the
worksheet that contain a value in the 1st ComboBox.
The only thing i need to work on now is to have the ComboBox Value FOUND
across all sheets and a list of sheets displayed.
I will place this in a New post.

Thanks Again Mike,
you are a Champion.

Corey....

Private Sub UserForm_Activate()
Dim i As Integer, j As Integer
Dim addit As Boolean, addit2 As Boolean
ComboBox3.Clear
For Each wks In Worksheets
addit = True
For i = 0 To ComboBox3.ListCount - 1
If ComboBox3.ListCount = 0 Then Exit For
If wks.Range("B3").Text = ComboBox3.List(i) Then addit = False Next i
If addit Then ComboBox3.AddItem wks.Range("B3").Text
Next wks
End Sub

Private Sub ComboBox3_Change() ComboBox4.Clear For Each wks In Worksheets
If wks.Range("b3").Text = ComboBox3.Value Then addit2 = True
For j = 0 To ComboBox4.ListCount - 1
If ComboBox4.ListCount = 0 Then Exit For
If wks.Range("D3").Text = ComboBox4.List(j) Then addit2 = False
Next j
If addit2 Then ComboBox4.AddItem wks.Range("D3").Text End If
Next wks
End Sub

Private Sub Combobox4_Change() Dim combolist
If ComboBox4.ListCount = 0 Then Exit Sub
For Each wks In Worksheets
If wks.Range("B3") = ComboBox3.Value And wks.Range("D3") = _
ComboBox4.Value Then combolist = combolist & wks.Name & Chr(10)
Next wks
' MsgBox (combolist)
End Sub

Private Sub CommandButton1_Click()
UserForm1.Hide
End Sub