How to format the first character of a string in an Excel 2010 cell

I would like to change the font color of the first character in a string within a cell.  Can this be done?
tballinAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

als315Commented:
You should have no problems if you will do it manually. How do you like to accomplish this?
0
tballinAuthor Commented:
I would like to setup a formatting rule - there's just too many cells to do this manually.
0
als315Commented:
You can't do it with formatting rule, because in these rules you can change colors only in whole cell, but you can do it with macro. Is it acceptable?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

tballinAuthor Commented:
A macro will work.
0
Martin LissOlder than dirtCommented:
Sub HighLightCell()

    Range("A1").Characters(1, 1).Font.Color = vbRed

End Sub
0
Martin LissOlder than dirtCommented:
Or
Sub HighLightCell()

    Range("A1").Characters(1, 1).Font.Bold = True 'etc.

End Sub
0
tballinAuthor Commented:
When I run this, the entire cell takes on the new format, not just the first character.
0
Martin LissOlder than dirtCommented:
Did you copy it correctly? This is what I see.
?
0
Martin LissOlder than dirtCommented:
Or the following where I did Range("A1").Characters(1, 1).Font.Size = 24.
??
0
tballinAuthor Commented:
I might be copying it wrong... but here's what I'm seeing:

code.JPGsheet.JPG
0
Martin LissOlder than dirtCommented:
Hmmm. It seems that it does that for numbers. Let me see what I can do.
0
Martin LissOlder than dirtCommented:
Sorry but if it's a number (even formatted as text) I don't think it can be done.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
This does it
Sub HighLightCell()

    Range("A2").Value = "'" & Range("A2").Value
    Range("A2").Characters(1, 1).Font.Color = vbRed
    Range("A2").HorizontalAlignment = xlRight
    
End Sub

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.