Greeting to all and thank you do much for any help you can provide. I am new into VBA and I am trying to resolve the following need. I have 2 Ranges C10:AQ26 & C34:AQ50. I want to change the font color of the last letter so it becomes invisible. What I mean, I need the font for the letter to match the background of the cell.
Sub Color_Part_of_Cell_1()
Dim r As Range
For Each r In Range("C10:AQ26")
r.Characters(InStrRev(r.Value, " ") + 1, 8).Font.Size = 1 ' the font change is optional
r.Characters(InStrRev(r.Value, " ") + 1, 8).Font.Color = RGB(217, 245, 242)
Next r
End Sub
---------------------------------------------------------------------------------------------
Sub Color_Part_of_Cell_2()
Dim r As Range
For Each r In Range("C34:AQ50")
r.Characters(InStrRev(r.Value, " ") + 1, 8).Font.Size = 1 ' the font change is optional
r.Characters(InStrRev(r.Value, " ") + 1, 8).Font.Color = RGB(217, 245, 242)
Next r
End Sub
- If cell = 0 then Font= White ; Fill= white
- If Cell is Number + X then Number= Dark Blue, Letter X = Light Blue ; Fill= Light Blue
- If Cell is Number + E then Number= Dark Green, Letter E = Light Green ; Fill= Light Green
- If Cell is Number + B then Number= Dark Red, Letter B = Pink ; Fill= Pink
- It's extremely slow
- I doesn't allow me to match the fill color to the last letter color.
Sub Color_Part_of_Cell_1()
Dim r As Range
For Each r In Range("C10:AQ26")
r.Characters(InStrRev(r.Value, " ") + 1, 8).Font.Size = 1 ' the font change is optional
r.Characters(InStrRev(r.Value, " ") + 1, 8).Font.Color = RGB(217, 245, 242)
Next r
End Sub
---------------------------------------------------------------------------------------------
Sub Color_Part_of_Cell_2()
Dim r As Range
For Each r In Range("C34:AQ50")
r.Characters(InStrRev(r.Value, " ") + 1, 8).Font.Size = 1 ' the font change is optional
r.Characters(InStrRev(r.Value, " ") + 1, 8).Font.Color = RGB(217, 245, 242)
Next r
End Sub