Consulting

Results 1 to 12 of 12

Thread: Conditional formatting color question

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Conditional formatting color question

    Is there a way to test if a cell has a certain conditional formatting color in code?
    Peace of mind is found in some of the strangest places.

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Why don't you just use the condition?

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by austenr
    Is there a way to test if a cell has a certain conditional formatting color in code?
    It is possible, but not easy.

    See http://www.xldynamic.com/source/xld.CFConditions.html

  4. #4
    VBAX Mentor
    Joined
    Jun 2005
    Posts
    374
    Location
    hello
    plese show an example.
    moshe

  5. #5
    Knowledge Base Approver
    The King of Overkill!
    VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    Austen,

    Take a look at http://www.vbaexpress.com/kb/getarticle.php?kb_id=190 and http://www.cpearson.com/excel/CFColors.htm
    You should be able to get the info you need from there! Let us know if you need any help.

    Matt

  6. #6
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks Matt, Bob
    Peace of mind is found in some of the strangest places.

  7. #7
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Ok. Maybe there is another option. Is there a way using a formula to set the font to a different color if two cells are not the same value?
    Peace of mind is found in some of the strangest places.

  8. #8
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Hi Austen,

    Uh, are you talking about "A1<>B1" type of CF formula?

  9. #9
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Hey Zack,

    Yes. Something that will change the color of the font. But having said that, to something you can test the cell on. Since you can not do it easily with the colors supplied by CF. What I want to end up doing is identifying rows where cells are a different color which would work off of some match or index function in combination with maybe an IF formula.

    Example:

    If B1 <> A1 change B1 to font color red. Then be able to select that row based on the color of the font in B1. HTH
    Peace of mind is found in some of the strangest places.

  10. #10
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by austenr
    Hey Zack,

    Yes. Something that will change the color of the font. But having said that, to something you can test the cell on. Since you can not do it easily with the colors supplied by CF. What I want to end up doing is identifying rows where cells are a different color which would work off of some match or index function in combination with maybe an IF formula.

    Example:

    If B1 <> A1 change B1 to font color red. Then be able to select that row based on the color of the font in B1. HTH
    You can use CF to set the colour based on a condition, that is what CF is, but you won't get a function that to identify that.

    But if you just want to identify the row, why not CF the whole row based upon one or two cells.

  11. #11
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    That wont work because I am examining each cell on the row. If any cell is <> to the test condition then you could CF the whole row.
    Peace of mind is found in some of the strangest places.

  12. #12
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by austenr
    That wont work because I am examining each cell on the row. If any cell is <> to the test condition then you could CF the whole row.
    So count them

    =COUNTIF(1:1,">10)>0

Posting Permissions

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