Sub FindAll()
'http://www.mrexcel.com/forum/excel-questions/959624-code-can-report-out-same-fields-excel-find-replace-tool.html
Dim Sh As Worksheet
Dim summmary As Worksheet
Dim Loc As Range
Dim searchMethod As Integer
'get the string to find
FindThis = InputBox("Enter Text to Find", "Find All Matches")
'if Cancel button, end
If FindThis = "" Then Exit Sub
'Whole or Part Cell match?
searchMethod = MsgBox("Match Whole Field?" & vbNewLine & "(Yes for Whole, No for Partial Field)", 3, "Match Type")
'2=Cancel, 6=Yes, 7=No
If searchMethod = 2 Then Exit Sub
'test to see if there is a Summary sheet
Set summary = Nothing
On Error Resume Next
Set summary = Sheets("Summary")
On Error GoTo 0
'if there is a Summary sheet
If Not summary Is Nothing Then
'clear contents
summary.Cells.ClearContents
Else
'create a new "Summary" sheet
ActiveWorkbook.Sheets.Add.Name = "Summary"
Set summary = Worksheets("Summary")
End If
'set title row on Summary sheet
summary.Range("A1") = "String to Find: " & Chr(34) & FindThis & Chr(34)
summary.Range("B1") = "Worksheet"
summary.Range("C1") = "Cells"
'go thru each worksheet
For Each Sh In ThisWorkbook.Worksheets
'if you're on Summary, skip this sheet
If Sh.Name = "Summary" Then GoTo skipSummary
With Sh.UsedRange
'look for the text string
Set Loc = .Find(what:=FindThis, _
LookAt:=searchMethod - 5, SearchOrder:=xlByRows)
'if you find a match
If Not Loc Is Nothing Then
'record the first location
firstaddress = Loc.Address
Do
'find the last row in the Summary sheet
Lastrow = summary.Cells(summary.Rows.Count, "A").End(xlUp).Row
'add the values
Cells(Lastrow + 1, 1) = Loc.Value
Cells(Lastrow + 1, 2) = Sh.Name
summary.Hyperlinks.Add Anchor:=Cells(Lastrow + 1, 3), Address:="", _
SubAddress:=Sh.Name & "!" & Loc.Address, TextToDisplay:=Loc.Address
'find next
Set Loc = .FindNext(Loc)
Loop While Loc.Address <> firstaddress
Else
'count the number of not founds
nf = nf + 1
End If
End With
Set Loc = Nothing
skipSummary:
Next
'if the not found count matches the number of worksheets -1
If nf = ThisWorkbook.Sheets.Count - 1 Then
'print "No matches found"
summary.Cells(2, 1) = "No matches found"
End If
End Sub