Advertisement
oshkoshbagoshh

searchbox_highlight

Aug 18th, 2017
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '**************************************************************
  2. ' Tell the input box what value you want to search for.
  3. ' --NOTE: MUST BE EXACT VALUE
  4. '***********************************************************
  5.  
  6. Sub highlightSpecificValues()
  7. Dim rng As Range
  8. Dim i As Integer
  9. Dim c As Variant
  10. c = InputBox("Enter Value To Highlight")
  11. For Each rng In ActiveSheet.UsedRange
  12. If rng = c Then
  13. rng.Style = "Note"
  14. i = i + 1
  15. End If
  16. Next rng
  17. MsgBox "There are total " & i & " " & c & " in this worksheet."
  18. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement