Default font color

J

Jason

How do I change the default color for a sheet such that if
I retype a cell that is currently black, and I want to
make it blue, I don't have to keep going back to the Font
Color button?

Thanks!
 
P

Peter Atherton

Jason

Conditional formatting will allow you to automatically
change colours based on three conditions.

Choose, Format, Conditional formatting, and enter a first
condition e.g. Cell value > 50 then change the colour
background.

More than three conditions will require a macro.

Regards
Peter
 
D

Dave Peterson

You might be able to use an event macro that looks for changes:

Rightclick on the worksheet that should have this behavior and select View Code.

Paste this in:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then Exit Sub
With Target
If .Font.ColorIndex = xlAutomatic _
Or .Font.ColorIndex = 1 Then
.Font.ColorIndex = 41
End If
End With
End Sub

The xlautomatic and 1 both look black in my test workbook. And 41 was a light
blue. Record a macro when you set a test cell to blue, black, and automatic to
get the numbers you want.

But if you hit F2, then enter, excel will see this as a change. But F2, escape
not do the change.

And be aware that you'll lose Edit|Undo if you use this macro.
 
J

Jason

I tried this macro as well and it seemd to work:

Private Sub Worksheet_Change(ByVal Target As Range)
Target.Font.ColorIndex = 5
End Sub

-andy
 
D

Dave Peterson

What happens to the cells that were red? (I thought you really meant that stuff
about the black font.)

glad it worked ok for you.
 
Top