ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I change Font color specific text (https://www.excelbanter.com/excel-discussion-misc-queries/263272-how-do-i-change-font-color-specific-text.html)

JLR

How do I change Font color specific text
 
How do I change the font color in the first 4 letters of text in a column of
cells?
Thanks.
--
jlr

Gary''s Student

How do I change Font color specific text
 
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

--
Gary''s Student - gsnu201002


"jlr" wrote:

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



All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com