I have cells with a concatenated list of words (with textjoin) and I want to colorate words differently to make it more readable. Just an example to better explain my problem: 5 Apples / 2 Oranges / 3 Bananas / 5 Apples / 2 Kiwis / 3 Oranges I would need to put the apples in red and the oranges in orange.
Do you have a solution on this? Thanks in advance!
I was able to find an example on this forum to color text in cells using VBA and the InStr function, but the problem I am having is that the words are often repeated and InStr doesn't work for multiple entries:
AppleStartPosition = InStr(1, CurrentCellText, "Apple")
If AppleStartPosition > 0 Then
ActiveSheet.Cells(Row, Col).Characters(AppleStartPosition, 5).Font.color = RGB(255, 0, 0)
End If


As @Rory commented first convert to static value the cell content e.g. with Copy and PasteSpecial/Values either in excel or in vba and then
This is an example code where
cellofrange is the range to color
colarr is the array of the colors to apply
this colors the letters only and change a color when a non letter character found.