I'm assuming that you want the font color changed as to opposed to a cell highlight (i.e. fill). A cell with a black fill would require a font color change as well.
Tap Alt+F11 and when the VBE opens, immediately use hte pull-down menu to Insert, Module. Paste the following into the new pane titled something like Book1 - Module1 (Code),
Sub mcrFinancial_Color_Codes()
Dim rng As Range, rErr As Range
On Error Resume Next
For Each rng In Intersect(ActiveSheet.UsedRange, Selection)
If rng.HasFormula Then
Set rErr = Range(Mid(rng.Formula, 2, Len(rng.Formula) - 1))
If CBool(Err) Then
rng.Font.ColorIndex = 1 'black
Else
rng.Font.ColorIndex = 4 'green
End If
Err = 0
ElseIf CBool(Len(rng.Value)) Then
rng.Font.ColorIndex = 5 'blue
Else
rng.Font.ColorIndex = xlAutomatic 'default
End If
Next rng
Set rErr = Nothing
End Sub
Tap Alt+Q to return to your worksheet. Select a range of cells and tap Alt+F8 to Run the macro. You also can tap Alt+F8 and use Options to assign a shortcut key combination.
Here is an image of an Excel table demonstrating the basic ColorIndex colors: