Good Morning Team!
I have a script that highlights the first cell of a row that contains a search result. I would like to highlight all the cells from that row. Does anybody have any idea how to make this possible.
This is how my VBA script looks like. (I'm using Excel 2016 on a Windows 10 environment)
Sub SearchAndHighlight()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim ThisArea As Range, SearchMe As String
Sheets("Master List").Activate
SearchMe = InputBox("Search format Belk XXXX.")
If IsEmpty(SearchMe) Then Exit Sub
Set ThisArea = Sheets("Master List").Cells.Find(SearchMe, lookat:=xlWhole)
If ThisArea Is Nothing Then
MsgBox SearchMe & " - " & "There is no such entry."
Else
Cells.Interior.ColorIndex = xlColorIndexNone
ThisArea.Interior.ColorIndex = 6
Application.Goto ThisArea, True
End If
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
I have a script that highlights the first cell of a row that contains a search result. I would like to highlight all the cells from that row. Does anybody have any idea how to make this possible.
This is how my VBA script looks like. (I'm using Excel 2016 on a Windows 10 environment)
Sub SearchAndHighlight()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim ThisArea As Range, SearchMe As String
Sheets("Master List").Activate
SearchMe = InputBox("Search format Belk XXXX.")
If IsEmpty(SearchMe) Then Exit Sub
Set ThisArea = Sheets("Master List").Cells.Find(SearchMe, lookat:=xlWhole)
If ThisArea Is Nothing Then
MsgBox SearchMe & " - " & "There is no such entry."
Else
Cells.Interior.ColorIndex = xlColorIndexNone
ThisArea.Interior.ColorIndex = 6
Application.Goto ThisArea, True
End If
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub