+ Reply to Thread
Results 1 to 4 of 4

Can a Function determine the color of a cell or the text in a cell?

  1. #1
    Registered User
    Join Date
    02-08-2008
    Posts
    11

    Can a Function determine the color of a cell or the text in a cell?

    I'd like to know if there is a way to have a function determine the color of a cell. For example I have 3 cells (a1,a2,a3). In A1 I have the number "3" and in A2 I have the number "4". Now I want the cell A3 to turn red or green depending on whether A1 > A2.

    The only thing I can think of would be to use an =if function like "=if(a1>a2,"a3 turns green","A3 turns red")"

    If there is some way to do that I'd sure like to know. It would help me out a lot.

    ~Erin

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try Conditional formatting

    http://www.contextures.com/xlCondFormat01.html

    Could use

    =$A$1>$A$2
    for red condition
    =$A$1<$A$2
    for green condition

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    You are looking for Conditional Formatting. It's on the Format dropdown menu.
    Write in a formula that has either a true or false result (such as =A1>A2) and then set the format conditions and if the formula result is true, the formats occur. The down side is you are restricted to 3 situations (formats)

    Let us know if you have problems.

    ChemistB

  4. #4
    Registered User
    Join Date
    02-08-2008
    Posts
    11
    You guys are awesome... as usual.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 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