Hi - I have some VBA code that searches for a Text.value in all worksheets in a workbook via a USERFORM
The code works fine and returns a message box stating which worksheets the Text.values are in. I want it to bring up this Message box, but now give the option to "Take me there" rather than it just be the "OK" option.
As there may be more than one of the same Text.values in the workbook the current code loops and brings up each result one at a time, so would need 2 buttons in the result "Take me there" and "Continue" being the options until the loop ends with the final search return as "This It !" (or such like) - Hope that makes sense?
I really hope someone can help??
I'm learning all the time from the great responses from this forum ! 
THANKS ALL !
Here is my current Coding assigned to the USERFORM.......
Private Sub CommandButton1_Click()
Dim Mysearch As String
Unload Me
Dim Sh As Worksheet, myCounter
Dim Loc As Range
Mysearch = TextBox1.Value
For Each Sh In ThisWorkbook.Worksheets
With Sh.UsedRange
Set Loc = .Cells.Find(What:=Mysearch)
If Not Loc Is Nothing Then
MsgBox ("' " & Mysearch & " '" & " was is found in sheet - " & Sh.Name)
myCounter = 1
Set Loc = .FindNext(Loc)
End If
End With
Next
If myCounter = 0 Then
MsgBox ("Sorry... ' " & Mysearch & " ' is not present in any of the department sheets")
End If
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Bookmarks