My macro searches all open workbooks for the active cell value (e.g. 98%). However, it only finds the value 0.98 but not the value 98% in other cells. Why?
Here is my macro:
Sub FindIt2()
Dim wSheet As Worksheet
Dim wBook As Workbook
Dim rFound As Range
Dim firstAddress As String
lookfor = Selection.Value
On Error Resume Next
For Each wBook In Application.Workbooks
For Each wSheet In wBook.Worksheets
Set rFound = wSheet.Cells.Find(What:=lookfor, After:=wSheet.Cells(1, 1), _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
If Not rFound Is Nothing Then
firstAddress = rFound.Address
Do
Application.Goto rFound, True
MsgBox "The Search String has been found these locations: "
Set rFound = wSheet.Cells.FindNext(rFound)
Loop While Not rFound Is Nothing And rFound.Address <> firstAddress
End If
Next wSheet
Next wBook
On Error GoTo 0
Anyone has an Idea how to solve this? Thanks!
EDIT: I want it to find both: 98% and 0.98