How do I change Font color specific text

J

jlr

How do I change the font color in the first 4 letters of text in a column of
cells?
Thanks.
 
G

Gary''s Student

Here is an example for column D:

Sub ColorMeElmo()
Set r = Intersect(ActiveSheet.UsedRange, Range("E:E"))
For Each rr In r
If Len(rr.Value) > 4 Then
rr.Characters(Start:=1, Length:=4).Font.ColorIndex = 6
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top