Set default font color?

  • Thread starter Thread starter Bradley C. Hammerstrom
  • Start date Start date
B

Bradley C. Hammerstrom

E2K

I want to be able to edit a sheet (with all black text) and have anything I
type in whichever cell have a certain color, say, red--even though the
existing cell formatting has *automatic* as the font color.

Is there some VBA or a macro I could use that would change the cell's Style
or formatting with an OnUpdate event, or similiar?

Brad H.
 
Hi
create a template for this and change the default color to red in this
template
 
Frank,

Thank you for your reply, but I stated that I need to edit an existing
workbook with automatic (default) cell font formatting, and then have a
button, or similar, to push that makes all subsequent typing in red, until
another button is pushed (change all subsequent typing back to black).

Brad H.
 
How about using a cell to indicate the color:

Rightclick on the excel icon to the left of File (on the menubar).
Select View Code
Paste this in:

Option Explicit
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

Dim myColor As Long

If Me.Worksheets("Sheet1").Range("a1").Value = True Then
myColor = 3
Else
myColor = xlAutomatic
End If

Target.Font.ColorIndex = myColor

End Sub

Adjust your cell's address and your favorite color.
 

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

Back
Top