+ Reply to Thread
Results 1 to 3 of 3

Counting cells conditionally formatted, by colour

  1. #1
    Registered User
    Join Date
    06-10-2011
    Location
    Mansfield, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Counting cells conditionally formatted, by colour

    Hi,

    I am trying to find a way to count the number of cells that are conditionally formatted with a certain fill colour.
    I have searched the web and found several posts that say how tricky it can be and and some that suggest using a function that recreates the formula of the conditional formatting. but sadly, I do not know how to replicate easily the formula used, and the code i found to count the Conditional formats does not appear to work. I believe it is because of the type of conditional format I have selected.
    So can any one help? here is what I am trying to do.

    I have a quite large and complex spreadsheet that has lots of data, amongst this are 4 columns containing user ID's (A user can have a Main identifier and up to 3 alternate Identifiers). But I need to check for Duplicate user ID's across all 4 ID columns eg Does and ID exist in Col H, or Col K or Col M or Col T? if so colour all the duplicate cells in red.
    Now Excel 2007's conditional formatting has let me do this very easily, because it has a built in function that allows me to format "only Unique or Duplicate Values" and it applies to the "Range selected". So I can select the non contiguous columns of H, K, M and T and select a fill colour of Red, and this works perfectly.

    However, I need to count those coloured cells. As I said right at the beginning, I do not know how i could construct the formula to be the same as the conditional formatting.
    The code I have found on other sites does not work on the cells Conditionally formatted in this way (its does work with cells that are conditionally formatted in a far simpler way, so I am sure it is not me using the code wrong)

    Any help would be greatly appreciated

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Counting cells conditionally formatted, by colour

    Try this: http://www.cpearson.com/excel/cfcolors.htm

    it would help

    Best Regards

  3. #3
    Registered User
    Join Date
    06-10-2011
    Location
    Mansfield, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Counting cells conditionally formatted, by colour

    Sadly, that's the function I tried, but it does not work in my "Duplicates" conditional formatting. If I run the ActiveCondition function on a cell that has no conditional formatting, it returns zero (which is the correct result), but if I run it against one of my conditionally formatted cells, it returns a #Value error

+ 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