That's a tricky one: I got 3 different numbers extracted by three different formulas in the same cell (as the image below).
Is there a way to color those numbers with different styles (i.e. first blue, second green, third bold)?
Thank you!
That's a tricky one: I got 3 different numbers extracted by three different formulas in the same cell (as the image below).
Is there a way to color those numbers with different styles (i.e. first blue, second green, third bold)?
Thank you!
Here is what you need, all you have to do is swap the Range("A3") with the one you have =]
Sub Color_Part_of_Cell()
Dim cont1 As Integer
Dim cont2 As Integer
cont1 = WorksheetFunction.Search("%", Range("A3"))
cont2 = Len(Mid(Range("A3"), WorksheetFunction.Search("-", Range("A3"), 1), _
WorksheetFunction.Search("%", Range("A3"), _
WorksheetFunction.Search("-", Range("A3"), 1)))) - cont1 - 2
With Range("A3")
.Characters(1, cont1).Font.Color = RGB(0, 0, 255)
.Characters(cont1 + 3, cont2).Font.Color = RGB(0, 255, 0)
.Characters(cont1 + cont2 + 6, 10).Font.Bold = true
End With
End Sub