LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Change the font color based on the value of the cell

If you really want VB code instead of the Conditional Formatting I
recommended earlier, then use this worksheet event code instead (where you
would change the A1 to the cell address of the "particular cell" you want to
have this functionality)...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0,0) < "A1" Then Exit Sub
If Target.Value Mod 2 = 1 Then
Target.Font.ColorIndex = 3
ElseIf Target.Value = "0" Or Target = "00" Then
Target.Font.ColorIndex = 4
Else
Target.Font.ColorIndex = 0
End If
End Sub

--
Rick (MVP - Excel)


"Robin" wrote in message
...
How do I create a macro or program to change the font color of a
particular
cell based on the value of the cell, e.g. 1 3 5 7, change the font color
to
red, if 0, 00 change font color to green and bold, thanks in advance




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i change row font color based on cell value in that row brianatkraft Excel Worksheet Functions 5 November 2nd 06 08:53 PM
change font color of cell based on critera amrezzat[_9_] Excel Programming 2 November 20th 05 11:07 PM
change font color of cell based on critera amrezzat Excel Worksheet Functions 1 November 20th 05 03:54 PM
Change Font Color in cell Based on another cell value John Excel Programming 2 November 18th 05 05:28 PM
Font to change color automatically based on value in cell. mtwelsh72 Excel Programming 3 January 23rd 05 06:41 PM


All times are GMT +1. The time now is 06:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"