Change font color automatically

D

dcb1

When I select the letter 'X' from a drop down list, I want it to
display it in red automatically. However, I don't want to have to
change the font color. Therefore, each time I enter this character---
the font will be shown in red. Anything else I choose from this list
will display in black (which of course is the default). Is there a
way to do this? Or, even if it is not from a drop down list, when I
enter a particular character in a cell--- I want it to show that
particular character in a specific color.
 
T

TGV

Using conditional formatting it can be done

1. Select the cell/Range
2. From menu Format>Conditional Formatting>
3. For Condition1>Select 'Formula Is' and enter =a1="x"
4. Click Format Button>Font>Color select 'red' then give ok

Change a1 to ur desired cell.
 
D

Don Guillett

If you don't want a lot of CF then right click sheet tab>view code>insert
this. Set to col E now.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 5 Or Target.Count <> 1 Then Exit Sub
Select Case LCase(Target)
Case "x": mc = 3
Case "y": mc = 5
Case Else
mc = 0
End Select
'Application.EnableEvents = False
Target.Font.ColorIndex = mc
'Application.EnableEvents = True
End Sub
 
D

dcb1

Thank you very much for the help--- it worked.

Using conditional formatting it can be done

1. Select the cell/Range
2. From menu Format>Conditional Formatting>
3. For Condition1>Select 'Formula Is' and enter =a1="x"
4. Click Format Button>Font>Color select 'red' then give ok

Change a1 to ur desired cell.

--
If this post helps, pls click Yes
---------------
TGV





- Show quoted text -
 
D

dcb1

I tried what you gave me; however, I wasn't successful (I was
uncertain on the first part where you said right click sheet tab>view
code>?) I have excel 2007 if that makes any difference. Anyhow, I
appreciate you taking the time to help me. I was able to use the
other solutions given. Thanks again. Also, I have another problem I
am trying to figure out. I will post it--- maybe you can help me.
 
D

Don Guillett

I just tested using xl2007.
Right click sheet tab>view code>copy/paste the macro. It will work for col
E.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
I tried what you gave me; however, I wasn't successful (I was
uncertain on the first part where you said right click sheet tab>view
code>?) I have excel 2007 if that makes any difference. Anyhow, I
appreciate you taking the time to help me. I was able to use the
other solutions given. Thanks again. Also, I have another problem I
am trying to figure out. I will post it--- maybe you can help me.
 

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