+ Reply to Thread
Results 1 to 12 of 12

Check font color and return a True or False

  1. #1
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118

    Check font color and return a True or False

    I am looking for a formula to return either True/False in Column J if the font color in Column H is Red.

    Is there a formula that can do this?
    Last edited by randolphoralph; 11-24-2008 at 06:49 PM.

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Here is UDF for the same


    Please Login or Register  to view this content.
    Usage :--

    =isRed(A1)

    will return True if A1 is red else it will return false

  3. #3
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118
    I entered the code provided into a UDF and it returns false on cells where the font color is red and black.

    Did I do something wrong?

  4. #4
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Have you created a new module and entered the code there or have u used sheet1/sheet2/sheet3 module..

  5. #5
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118
    I entered a new Module under PERSONAL.xls

  6. #6
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Hi,

    I have attached a spreadsheet..See if this is what you want..
    If any modification need tell me .. i will do that

    If Red.. .it will be true else it will display false
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118
    I see why it did not work.

    I am trying to see if the color of the Font is Red.

    Not the fill color.

    Sorry for the confusion.

  8. #8
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    not a problem..

    for font color the is code is almost similar

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-24-2008
    Location
    San Antonio, Texas
    Posts
    118
    Thanks a million!

  10. #10
    Registered User
    Join Date
    06-20-2012
    Location
    NYC
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Check font color and return a True or False

    This code snipet worked better for me because the tested cell was made "red" based on a Conditional Format "Formula Is" script.

    Function isRed(cell As Range) As String
    If cell.Font.Color = red Then
    isRed = "old"
    Else
    isRed = "Valid"
    End If
    End Function

    Function isRed(cell As Range) As Boolean
    If cell.Font.Color = red Then
    isRed = True
    Else
    isRed = False
    End If
    End Function

  11. #11
    Registered User
    Join Date
    12-21-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Check font color and return a True or False

    Hi Guys!

    I want to check if two font colours are equal (in an IF function), then ... do something

    So if this cell's font colour = this cells font colour

    How can i do that ?

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,727

    Re: Check font color and return a True or False

    martyy007 we3lcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1