Highlight cells containing a specific Text in a selection
Sub HighlightValuesInSelection()
Dim X As Range
Dim c As Variant
c = InputBox("Enter Value To Highlight")
For Each X In Selection
If X = c Then
X.Interior.ColorIndex = 8
End If
Next X
End Sub
Highlight cells containing a specific Text in the active sheet
Sub HighlightValuesInActiveSheet()
Dim X As Range
Dim c As Variant
c = InputBox("Enter Value To Highlight")
For Each X In ActiveSheet.UsedRange
If X = c Then
X.Interior.ColorIndex = 6
End If
Next X
End Sub
How to use codes shared here?