Since the information you gave was limited i had to make a few assumptions:
Option Explicit
Sub Highlight()
Dim ws1 As Worksheet: Set ws1 = Sheets("Sheet1")
Dim lastrow As Long
Dim ivalue As Variant
Dim icell As Range
Dim Msg1 As String
'code
ivalue = Application.InputBox("Enter your search string here.", "Search & Highlight")
lastrow = ws1.Range("A" & Rows.Count).End(xlUp).Row
'err handling
If ivalue = False Then
Exit Sub
ElseIf ivalue = "" Then
GoTo Err0
End If
'code
For Each icell In ws1.Range("A1", "A" & lastrow)
If InStr(1, icell, ivalue, vbTextCompare) Then
icell.Interior.ColorIndex = 6
End If
Next icell
Exit Sub
'err handling messages
Err0:
Msg1 = MsgBox("You did not enter a proper search value.", vbOKOnly, "Error")
End Sub
Assumptions:
1. Only one worksheet is involved and it is names Sheet1
2. Column A has information in the last most row.
3. The search criteria is taking place in column A.
If any of these things are incorrect you are going to need to adjust the code to meet your needs. More specifics are better.
Bookmarks