![]() |
How to: text color depend on value
Anyone know how to make the text change colors, depending on what valu certain data is? I'm sure it's easy... -- bobsmith58 ----------------------------------------------------------------------- bobsmith58d's Profile: http://www.excelforum.com/member.php...fo&userid=1452 View this thread: http://www.excelforum.com/showthread.php?threadid=26148 |
How to: text color depend on value
Hi Bob,
Try using conditional formatting. If you are not familiar with this feature, see Debra Dalgleish's excellent tutorial at: http://www.contextures.com/xlCondFormat01.html --- Regards, Norman "bobsmith58d" wrote in message ... Anyone know how to make the text change colors, depending on what value certain data is? I'm sure it's easy.... -- bobsmith58d ------------------------------------------------------------------------ bobsmith58d's Profile: http://www.excelforum.com/member.php...o&userid=14520 View this thread: http://www.excelforum.com/showthread...hreadid=261484 |
How to: text color depend on value
Hi Bob Her is a chunk of code I use as you will see the relevant part conditionally colour codes cell values Range("w6").Select For r = 1 To 230 For z = 1 To rowl task = ActiveCell.Value If Left(task, 1) = "" Then crt = Mid(task, 2) If Left(task, 1) = "" Then ActiveCell.Value = crt If Left(task, 1) = Chr$(126) Then crt = Mid(task, 2) If Left(task, 1) = Chr$(126) Then ActiveCell.Value = crt If task = "Not detected" Then ActiveCell.Value = "N/D" If task = "n/a" Then ActiveCell.Value = "." If task = "Listeria Monocytogenes" Then ActiveCell.Value = "L.mono" If task = "To Follow" Then ActiveCell.Value = "T.F." If task = "Listeria species not monocytogenes" Then ActiveCell.Value = "List not mono" If task = "Positive" Then ActiveCell.Value = "Pos" Rem grading If ActiveCell.Comment Is Nothing Then ADVERSE = 1 If ADVERSE = 0 Then ActiveCell.Font.ColorIndex = 5 <<<<<<<<<<<< This what you want If ADVERSE = 0 Then ActiveCell.Offset(0, -r).Select ActiveCell.Offset(0, -21).Select If ADVERSE = 0 Then ActiveCell.Font.ColorIndex = 5 If ADVERSE = 0 Then ActiveCell.Offset(0, r).Select ActiveCell.Offset(0, 21).Select ADVERSE = 0 ActiveCell.Offset(1, 0).Select Next "Norman Jones" wrote in message ... Hi Bob, Try using conditional formatting. If you are not familiar with this feature, see Debra Dalgleish's excellent tutorial at: http://www.contextures.com/xlCondFormat01.html --- Regards, Norman "bobsmith58d" wrote in message ... Anyone know how to make the text change colors, depending on what value certain data is? I'm sure it's easy.... -- bobsmith58d ------------------------------------------------------------------------ bobsmith58d's Profile: http://www.excelforum.com/member.php...o&userid=14520 View this thread: http://www.excelforum.com/showthread...hreadid=261484 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004 |
All times are GMT +1. The time now is 05:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com