C
Carni
I need to search for a substring within a text string, and if it is
present, change the colour of the text, for the substring only, to
highlight it.
For example, I have a sheet with 1 column and 200 rows containing text
strings 100 characters long. I want to find all instances of the text
string "CAT" in any cell and then change the colour of the letters CAT
wherever found. Also I need to add an index in the second column, with
a value of "1" if the substring was found in the same row or a "0" if
not found.
I know I can search for substrings and return starting positions with
worksheet functions (this could be used to build the index column) but
I do not know how to change the font colour of a substring.
present, change the colour of the text, for the substring only, to
highlight it.
For example, I have a sheet with 1 column and 200 rows containing text
strings 100 characters long. I want to find all instances of the text
string "CAT" in any cell and then change the colour of the letters CAT
wherever found. Also I need to add an index in the second column, with
a value of "1" if the substring was found in the same row or a "0" if
not found.
I know I can search for substrings and return starting positions with
worksheet functions (this could be used to build the index column) but
I do not know how to change the font colour of a substring.