Hey, I have a workbook with many worksheets. I am trying to write a
macro to search all the worksheets for a unique value. I have a
userform to enter the value and assign it to a variable. I just need
to search all sheet for that string, and if that string exists in a
worksheet, activate that worksheet. Anyone done anything like this?
Can you help?
This should be close...
Sub FindStuff()
Dim wks As Worksheet
Dim rngFound As Range
For Each wks In Worksheets
Set rngFound = wks.Cells.Find(What:="asdf", _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
MatchCase:=False)
If Not rngFound Is Nothing Then
wks.Select
rngFound.Select
Exit For
End If
Next wks
End Sub

Signature
HTH...
Jim Thomlinson
> Hey, I have a workbook with many worksheets. I am trying to write a
> macro to search all the worksheets for a unique value. I have a
> userform to enter the value and assign it to a variable. I just need
> to search all sheet for that string, and if that string exists in a
> worksheet, activate that worksheet. Anyone done anything like this?
> Can you help?