Find ALL WorkSheets according to 2 ComboBox Values.... Help wi
Corey,
Using the Excel Find... menu will not allow you to do what you want. It
searches each cell individually and therefore would find all the sheets with
"Fred" in it or all the sheets with "CV2" in it, but not both at the same
time.
Is there some reason why you need it to got through the Excel Find...? You
can have the list of sheets populate a message box (as I did in the code I
sent you) or you can have it write to a sheet, or an external file, etc.
Mike
"Corey" wrote:
OK Just got further now, thanks to Mikes reply to another of my posts.
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
HOW CAN I ADD TO THIS A FIND CODE TO DISPLAY ALL SHEETS THAT CONTAIN THE
USERFORM VALUE ??
Corey....
|