oshkoshbagoshh icon

searchbox_highlight

oshkoshbagoshh | PRO | 08/18/17 05:07:51 AM UTC | 0 ⭐ | 504 👁️ | Never ⏰ | []
VisualBasic |

510 B

|

None

|

0 👍

/

0 👎

'**************************************************************
' Tell the input box what value you want to search for. 
' --NOTE: MUST BE EXACT VALUE
'***********************************************************
 
Sub highlightSpecificValues()
Dim rng As Range
Dim i As Integer
Dim c As Variant
c = InputBox("Enter Value To Highlight")
For Each rng In ActiveSheet.UsedRange
If rng = c Then
rng.Style = "Note"
i = i + 1
End If
Next rng
MsgBox "There are total " & i & " " & c & " in this worksheet."
End Sub

Comments