Try this Macro
Press Ctrl, shift and F on the attachment.
Public MyStr As String
Sub Selector()
'I am using row one for labels so my first usable row is row 2
pos = 2
'I want to delete the "Search Results" sheet if it exists, So I am going to force an error
On Error GoTo NewSheet
'This blocks the message "Deleting Sheet Will Lose Data"
Application.DisplayAlerts = False
'This selects the results sheet, if it does not exist then we will goto NewSheet
Sheets("Search Results").Select
'This Deletes the Results Sheet
ActiveSheet.Delete
'This re-enables our error messages
Application.DisplayAlerts = True
'Create the Results Sheet
NewSheet:
Sheets.Add After:=ActiveSheet
ActiveSheet.Name = "Search Results"
ActiveSheet.Move Before:=Sheets(1)
'What Text do you want to search for?
MyStr = InputBox("Enter Text to Find", "Find Text Macro", "select", 100, 100)
'These are my Labels
Range("A1").Value = strValueToPic
Range("C1").Value = "Hyperlink"
' This resets our normal error routines
On Error GoTo 0
'Quit if search text is empty
If MyStr = "" Then Exit Sub
'Search for the Search String in each workbook except the results sheet
For Each ws In Sheets
If ws.Name = "Search Results" Then GoTo Skip
MyName = ws.Name
MyString = ""
With ws.Cells
Set rngFind = .Find(MyStr, .Cells(1, 1), LookIn:=xlValues, lookat:=xlWhole)
If Not rngFind Is Nothing Then
strFirstAddress = rngFind.Address
Do
MyString = MyString & MyName & "!" & rngFind.Address & ", "
Set rngFind = .FindNext(rngFind)
Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstAddress
End If
End With
'If Match Found then store data in Column A of results sheet
If MyString <> "" Then
'Convert MyString into an Array, so it is easy to save
MyArray = Split(MyString, ",")
'Where to save MyArray
Temp = Range(Cells(pos, 1), Cells(pos + UBound(MyArray), 1)).Address
'Save MyArray, The array is horizontal, transpose makes it vertical
Sheets("Search Results").Range(Temp).Value = Application.Transpose(MyArray)
'We need to increment pos so the next lot of data is saved below the existing data
pos = pos + UBound(MyArray)
End If
Skip:
Next
'This Creates The Hyperlinks in Column C
With Sheets("Search Results")
For Count = 2 To pos - 1
Temp = CStr(Application.Trim(Sheets("Search Results").Cells(Count, 1)))
ActiveSheet.Hyperlinks.Add Anchor:=.Cells(Count, 3), Address:="", SubAddress:=Temp, TextToDisplay:=Temp
Next
End With
End Sub
Bookmarks