Excel VBA: conditional format changing font color and cell color

I modified an example I downloaded that conditionally formatted a range of data based on text values.  It worked for "i color" and correctly shaded the cells.  I wanted to change the font color and I am struggling.  I thougth under "i.color" I could just add something like font.color = rgb (x,y,z) but it seems to be falling down.  Any help would be greatly appreciated.
Private Sub Worksheet_Change(ByVal Target As Range)

Dim icolor As Integer



    If Not Intersect(Target, Range("b81:k118")) Is Nothing Then

        Select Case Target

            Case "Book Value per Share to Price", "Cashflow per Share to Price", "Dividend Yield", "Earnings per Share to Price", "EBITDA to EV", "EBITDA to Price", "IBES Dividend Yield", "IBES Earnings Yield", "IBES Sales Yield", "Sales per Share to Price", "Sales to EV"

                icolor = 5
                
            Case "Growth in Earnings per Share", "IBES 12 Month Forward  Growth in Earnings per Share", "IBES Earnings Long Term Growth", "IBES FY1  Earnings Revisions 1M Sample", "IBES FY1  Earnings Revisions 3M Sample", "IBES FY2  Earnings Revisions 1M Sample", "IBES FY2  Earnings Revisions 3M Sample", "IBES Sales 12 Mth Growth", "IBES Sales Long Term Growth", "Income to Sales", "Return on Equity", "Sales Growth", "Sustainable Growth Rate"

                icolor = 4
               
            Case "Beta", "Market Cap"

                icolor = 3
                
            Case "Momentum 12 Mth", "Momentum 6 Mth", "Momentum Short Term (6 Month Exp Wtd)"

                icolor = 1
                
            Case "Debt to Equity (High)", "Foreign Sales as a % Total Sales"

                icolor = 6
                
            Case "Debt to Equity (Low)", "Low Accruals", "Stability Of Earnings Growth", "Stability Of FY1 Revisions", "Stability Of IBES 12 Mth Growth Forecast", "Stability of Returns", "Stability Of Sales Growth"

                icolor = 18
                
            Case "Momentum 12 Mth", "Momentum 6 Mth", "Momentum Short Term (6 Month Exp Wtd)"
                        
            
            Case Else

                'Whatever

        End Select

        

        Target.Interior.ColorIndex = icolor

    End If



End Sub

Open in new window

majervisAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
TracyConnect With a Mentor VBA DeveloperCommented:
You can do that, it would be:
Target.Font.Color = RGB(255, 0, 0)
0
 
TracyVBA DeveloperCommented:
For more on colors, check this out:
http://www.mvps.org/dmcritchie/excel/colors.htm
0
 
majervisAuthor Commented:
perfect.  thank you!
0
All Courses

From novice to tech pro — start learning today.