Hello,
I have found in one of your threads the following vba code to search a worksheet using an input box. It works great.
I was not wandering how to highlight in yellow the search result.
Thank you
I have found in one of your threads the following vba code to search a worksheet using an input box. It works great.
I was not wandering how to highlight in yellow the search result.
Thank you
VBA Code:
Sub Search()
Dim fnd As String
Dim FoundCell As Range
Dim Ws As Worksheet
Do
fnd = InputBox("Enter the SSN or any part of text you want to search")
'cancel pressed
If StrPtr(fnd) = 0 Then Exit Sub
Loop Until Len(fnd) > 0
For Each Ws In Worksheets
Set FoundCell = Ws.UsedRange.Find(fnd, , xlValues, xlPart, , , False, , False)
If Not FoundCell Is Nothing Then
Ws.Activate
FoundCell.Select
Exit Sub
End If
Next Ws
End Sub
Last edited by a moderator: