2 colors in formula

JAZZWAKEFOREST

Board Regular
Joined
Dec 1, 2005
Messages
92
I have created the formula below, but I would like to add color to the word GO and STOP. GO will be Green and Stop will be red. How do I do that? HELP

ActiveCell.FormulaR1C1 = "=IF(RC[1]=RC[-1],""GO"",""STOP"")"
 
JAZZWAKEFOREST said:
thank you!!! ITS WORKING...how can i add bold now?

The easiest way to find out is to record a macro while doing it manually. But try:

Code:
Range("I2").Select 
    With ActiveCell 
        .FormulaR1C1 = "=IF(RC[1]=RC[-1],""GO"",""STOP"")" 
        .FormatConditions.Delete 
        .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""GO""" 
        With .FormatConditions(1)
            .Font.ColorIndex = 10 
            .Font.Bold = True
        End With
        .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""STOP""" 
        With .FormatConditions(2)
            .Font.ColorIndex = 3 
            .Font.Bold = True
        End With
        .AutoFill Destination:=Range("I2:I9000"), Type:=xlFillDefault 
    End With 
    Range("I4").Select
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,216,050
Messages
6,128,498
Members
449,455
Latest member
jesski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top