View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Sheeloo Sheeloo is offline
external usenet poster
 
Posts: 793
Default Change Text Color in one cell based upon entry in referenced cell

You will have to use a Macro to do this.

You will need to loop through the cells in Col B and upate the
Interior.ColorIndex property of Cell in Col A based on the value in Col B.
Following will color cells A1, A2 and A3 with Yellow, Red, and Green.

Sub ColorCells
Range("A1").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("A2").Select
With Selection.Interior
.ColorIndex = 46
.Pattern = xlSolid
End With
Range("A3").Select
With Selection.Interior
.ColorIndex = 43
.Pattern = xlSolid
End With
End Sub

"Tee" wrote:

I have a row of 21 cells in column A. I have a row of 21 cells in column B.

I want column A4 to change text color based upon number entry into B4.

For instance, if I enter the number 1 into B4, I would like cell A4 text to
change to red.

For instance, if I enter the number 2 into B5, I would like cell A5 text to
change to blue.

I can't use conditional formatting b/c it only gives me up to three
conditions. I need 21 conditions.

Thanks in advance for your help!

Tee