I am trying to write some code that will look in an excel cell find if it contains the word that I am looking for and make it bold. I have written the following code so far
With Worksheets("Label Print").Cells(i, J)
.Characters(Start:=InStr(.Value, “Name”), Length:=Len(“Name”)).Font.Bold = True
End With
The issue is that if “Name” occurs twice (or more) in a cell it will highlight only its first occurrence.
Thank you in advance
Here’s a function that takes the cell to check and the word to search for and bolds all cases of that word:
Note 1: rngCell must be a single cell.
Note 2: the search is not case-sensitive… change vbTextCompare if necessary.