lior03
06-21-2005, 11:15 PM
hello
thanks to firefiter i got a macro to search all sheets in a workbook.
how can i make the inputbox appear only once to accept a value to search.
it popup on every sheet.what about if the value i look for appear more
then once in a sheet.
Sub searchers()
Application.ScreenUpdating = False
Dim ws As Worksheet
Dim x As String
For Each ws In ActiveWorkbook.Worksheets
Dim rngResult As Range
ws.Cells.Font.ColorIndex = 1
x = InputBox("choose value to search", "hadara")
Set rngResult = ws.Cells.Find(What:=x, LookIn:=xlValue, LookAt:=xlPart)
If rngResult Is Nothing Then
MsgBox x & " not found in " & ws.Name
Else
rngResult.EntireRow.Font.ColorIndex = 3
MsgBox x & " found in " & ws.Name
End If
Application.ScreenUpdating = True
Next ws
End Sub
thanks
moshe
thanks to firefiter i got a macro to search all sheets in a workbook.
how can i make the inputbox appear only once to accept a value to search.
it popup on every sheet.what about if the value i look for appear more
then once in a sheet.
Sub searchers()
Application.ScreenUpdating = False
Dim ws As Worksheet
Dim x As String
For Each ws In ActiveWorkbook.Worksheets
Dim rngResult As Range
ws.Cells.Font.ColorIndex = 1
x = InputBox("choose value to search", "hadara")
Set rngResult = ws.Cells.Find(What:=x, LookIn:=xlValue, LookAt:=xlPart)
If rngResult Is Nothing Then
MsgBox x & " not found in " & ws.Name
Else
rngResult.EntireRow.Font.ColorIndex = 3
MsgBox x & " found in " & ws.Name
End If
Application.ScreenUpdating = True
Next ws
End Sub
thanks
moshe