H
Hazel
Hi All
Elsewhere in this forum I found the following which I have altered to suit
my project.
Private Sub Find_Click()
Dim wksToSearch As Worksheets
Dim rngToSearch As Range
Dim rngFound As Range
Set wksToSearch = Sheets("ALTON")
Set rngToSearch = wksToSearch.Columns("A")
Set rngFound = rngToSearch.Find(What:=TextBox21.Value, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
MatchCase:=False)
If rngFound Is Nothing Then
MsgBox "Sorry " & TextBox21.Value & " was not found."
Else
wksToSearch.Select
rngFound.Select
End If
End Sub
and it works ok on the named sheet however there are 26 named sheets in the
workbook is it possible to search all the sheets after entering the ID number
in TextBox21. When it finds the ID Number on whatever row in whatever sheet
In TB2 on the Userform I would want it to show the value of ColumnB -- TB3
would show the value of Column C -- Tb4 would show the value of Column D.
Elsewhere in this forum I found the following which I have altered to suit
my project.
Private Sub Find_Click()
Dim wksToSearch As Worksheets
Dim rngToSearch As Range
Dim rngFound As Range
Set wksToSearch = Sheets("ALTON")
Set rngToSearch = wksToSearch.Columns("A")
Set rngFound = rngToSearch.Find(What:=TextBox21.Value, _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
MatchCase:=False)
If rngFound Is Nothing Then
MsgBox "Sorry " & TextBox21.Value & " was not found."
Else
wksToSearch.Select
rngFound.Select
End If
End Sub
and it works ok on the named sheet however there are 26 named sheets in the
workbook is it possible to search all the sheets after entering the ID number
in TextBox21. When it finds the ID Number on whatever row in whatever sheet
In TB2 on the Userform I would want it to show the value of ColumnB -- TB3
would show the value of Column C -- Tb4 would show the value of Column D.