colmguckian
New Member
- Joined
- Feb 11, 2011
- Messages
- 35
I have a macro which
Searches for a value in an inactive workbook. It searches for the value which is selected in ComboBox3. The macro I have does this, but it only searches Sheet1. I need it to search all the worksheets in the Workbook
Please see code below.
Dim wFind as Range
With Workbooks("book1").Worksheets("Sheet1").Range("A1:D500")
Set wFind = .Find(What:=Me.ComboBox3.Value, LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
If Not wFind Is Nothing Then
Me.TextBox1.Value = wFind.Offset(, 7)
Else: TextBox1 = Empty
End If
End with
Searches for a value in an inactive workbook. It searches for the value which is selected in ComboBox3. The macro I have does this, but it only searches Sheet1. I need it to search all the worksheets in the Workbook
Please see code below.
Dim wFind as Range
With Workbooks("book1").Worksheets("Sheet1").Range("A1:D500")
Set wFind = .Find(What:=Me.ComboBox3.Value, LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
If Not wFind Is Nothing Then
Me.TextBox1.Value = wFind.Offset(, 7)
Else: TextBox1 = Empty
End If
End with