I want a vba that can highlight the entire row when certain letters were found in word(s) in cells
i found the below code, but it works when there is an exact match ONLY.
i needPHP Code:
Sub colorentirerow_ifvalue()
Dim r As Variant
Dim k As Variant
Dim i As Variant
Range("A1", ActiveCell.SpecialCells(xlLastCell)).Select
For Each r In Selection
If r.Value Like "HUA" Then
r.EntireRow.Interior.ColorIndex = 22
End If
Next
Range("A1", ActiveCell.SpecialCells(xlLastCell)).Select
For Each k In Selection
If k.Value Like "KIND" Then
k.EntireRow.Interior.ColorIndex = 21
End If
Next
Range("A1", ActiveCell.SpecialCells(xlLastCell)).Select
For Each i In Selection
If i.Value Like "THANKS" Then
i.EntireRow.Interior.ColorIndex = 20
End If
Next
End Sub
1. partial matches to be highlight too.
e.g. A cell contains "CHANGHUA" or "HUACHANG" to be found and highlight the entire row
2. treats uppercase or lowercase as the same value.
e.g. A cell contains "hua" or "Hua" to be found and highlight the entire row
THANKS!
Bookmarks