Hello everybody,
First, love Excel forums, have helped me a lot in the last 2 years. Love you!
Now i have a question where i cannot find an answer:
I found a Macro in the Internet which helps me: It displays all cells that have a given value in it.
BUT it displays me the result in a Msgbox!
i would like to have it in Sheetxyz in column A.
Here is the formula:
Sub WBSearch()
Dim ws As Worksheet
theWord = InputBox("Enter text to search", "Search Criteria")
If theWord = "" Then
Exit Sub
End If
For Each ws In ActiveWorkbook.Worksheets
ws.Select
For Each cell In ActiveSheet.UsedRange
If InStr(1, UCase(cell.Value), UCase(theWord)) Then
wIndex = wIndex & Chr(10) & ActiveSheet.Name & " - " & _
cell.Address(0, 0)
End If
Next
Next
If wIndex = "" Then
MsgBox UCase(theWord) & " was not located in this workbook.", _
vbOKOnly, "Not Found"
Else
MsgBox wIndex, vbOKOnly, UCase(theWord) & " was found in:"
End If
End Sub
Thanks a lot in advance
Bookmarks