Here is the code I try to adapt to search in ALL sheets and not just Sheet1 (Code is in a userform)
How do you change Sheet.("Sheet1") to "All Sheets" ?
Thank you for your help
Option Explicit
Private Sub CommandButton1_Click()
Dim rngfind As Range
With Sheets("sheet1")
Set rngfind = .Range("B:B").Find(Me.TextBox1.Value, lookat:=xlWhole, MatchCase:=True)
If rngfind Is Nothing Then
MsgBox "Not Found"
Else
Me.TextBox2.Value = rngfind.Offset(0, 1).Value
Me.TextBox3.Value = rngfind.Offset(0, 2).Value
End If
End With
End Sub
How do you change Sheet.("Sheet1") to "All Sheets" ?
Thank you for your help
Option Explicit
Private Sub CommandButton1_Click()
Dim rngfind As Range
With Sheets("sheet1")
Set rngfind = .Range("B:B").Find(Me.TextBox1.Value, lookat:=xlWhole, MatchCase:=True)
If rngfind Is Nothing Then
MsgBox "Not Found"
Else
Me.TextBox2.Value = rngfind.Offset(0, 1).Value
Me.TextBox3.Value = rngfind.Offset(0, 2).Value
End If
End With
End Sub