#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2006
    Posts
    1
    Rep Power
    0

    Excel macro HELP! conditional font colors


    Hey Guys,
    Hope someone out there can help me with this macro. I know little to nothing about macros and I need big help. I need a macro that changes the font color to red when a percentage is entered with a value less than 4.9%. The font needs to change to green when the value is 5.0% or greater. Any help or directions would be greatly appricatied.
  2. #2
  3. Type Cast Exception
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    OAKLAND CA | Adam's Point (Fairyland)
    Posts
    14,883
    Rep Power
    890
    Code:
    Sub Example()
        With ActiveSheet
            If .Cells(1, 1) < 0.05 Then
                .Cells(1, 1).Font.Color = vbRed
            Else
                .Cells(1, 1).Font.Color = vbGreen
            End If
        End With
    End Sub

    Comments on this post

    • ingenuity agrees
    medialint.com

    “Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss

IMN logo majestic logo threadwatch logo seochat tools logo