Change font color when making changes

M

Mona

Is there a way to autmatically change the font color to say "blue" if I make
a change to a cell?

If I have "cat" in A1 and change it to "dog" I would like dog to be blue and
bold.

Is this possible with conditional formatting or ?

thanks!
 
G

Gord Dibben

Mona

Just the change from "cat" to "dog"could be done through CF.

But if that is just an example and if you mean any change at all in the cell
content the answer may be something else.


Gord Dibben MS Excel MVP
 
M

Mona

that was a very general example. It would be any change at all in the cell I
would like to have the color blue/bold.
 
G

Gord Dibben

OK

Copy paste this event code to your worksheet. Edit for range and cell ref(s).

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
'For a range of cells change to Me.Range("A1:A10")
On Error GoTo CleanUp
Application.EnableEvents = False
If Target.Value <> "" Then
With Target.Font
.ColorIndex = 5
.Bold = True
End With
End If
CleanUp:
Application.EnableEvents = True
End Sub

To install this, right-click on your sheet tab and "View Code"

Copy/paste into that module.

Gord
 
M

Mona

Thank you. Works great!!

Gord Dibben said:
OK

Copy paste this event code to your worksheet. Edit for range and cell ref(s).

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
'For a range of cells change to Me.Range("A1:A10")
On Error GoTo CleanUp
Application.EnableEvents = False
If Target.Value <> "" Then
With Target.Font
.ColorIndex = 5
.Bold = True
End With
End If
CleanUp:
Application.EnableEvents = True
End Sub

To install this, right-click on your sheet tab and "View Code"

Copy/paste into that module.

Gord
 

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