A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Just put one IF block
If IsNumeric(Cell.Value) Then
Hence, your macro would be
Sub ColorCodes()
For Each Cell In ActiveSheet.UsedRange
If IsNumeric(Cell.Value) Then
CF = Cell.Formula
Cell.Font.Color = RGB(255, 0, 0) 'Black
If Not Cell.HasFormula Then
Cell.Font.Color = RGB(255, 0, 255) 'Blue
ElseIf InStr(1, CF, "!") Then
Cell.Font.Color = RGB(0, 128, 0) 'Green
Else:
End If
End If
NextCell:
Next
End Sub