Consulting

Results 1 to 9 of 9

Thread: Solved: Count Colors of CF Cells

  1. #1
    VBAX Expert
    Joined
    May 2006
    Location
    Oklahoma City, OK
    Posts
    532
    Location

    Solved: Count Colors of CF Cells

    I have a Gantt Chart (range D8:IS378) that uses dates to fill the chart. Initially the chart fills in "blue" if the formula dates matches. The chart has two CF conditions that color the cells "red" and "blue". The two conditions looks in the columns "A" through "IS" for a "1" and then across the rows to see if there are more than two occurences and if there's a third occurences color the cell "red". I now want to count how many times a "red" cell occurs in each column to use for some other cells conditional formatting. This is the only way I can think of using since the cells that are in the range D8:IS378 don't have specific cell values.

    I've found several references that talks about how to do this, one by cpearson and another found in vbaexpress- http://www.xldynamic.com/source/xld.CFConditions.html

    this is the site that I've tried using, but have run into a compile error and can't figure out why. I've tried the reference three different ways (cells D2, E2 and F2) and can't seem to get it to run properly. I'm requesting your professional assistance.


    Charlie

    See attach file for compile error/s:

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by coliervile
    I have a Gantt Chart (range D8:IS378) that uses dates to fill the chart. Initially the chart fills in "blue" if the formula dates matches. The chart has two CF conditions that color the cells "red" and "blue". The two conditions looks in the columns "A" through "IS" for a "1" and then across the rows to see if there are more than two occurences and if there's a third occurences color the cell "red". I now want to count how many times a "red" cell occurs in each column to use for some other cells conditional formatting. This is the only way I can think of using since the cells that are in the range D8:IS378 don't have specific cell values.

    I've found several references that talks about how to do this, one by cpearson and another found in vbaexpress- http://www.xldynamic.com/source/xld.CFConditions.html

    this is the site that I've tried using, but have run into a compile error and can't figure out why. I've tried the reference three different ways (cells D2, E2 and F2) and can't seem to get it to run properly. I'm requesting your professional assistance.


    Charlie

    See attach file for compile error/s:
    No attachment Charlie.

  3. #3
    VBAX Expert
    Joined
    May 2006
    Location
    Oklahoma City, OK
    Posts
    532
    Location
    Okay, here's the worksheet and the various ways I've tried to do the counting. Any ideas or know solutions would be great!

    Charlie

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    There was a small typo on the page. I will get it corrected.

  5. #5
    VBAX Expert
    Joined
    May 2006
    Location
    Oklahoma City, OK
    Posts
    532
    Location
    Thanks "xld" for spotting it. I copied the formula directly off of the web. Just shows you that one has to be careful.

    Regards
    Charlie

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by coliervile
    Thanks "xld" for spotting it. I copied the formula directly off of the web. Just shows you that one has to be careful.

    Regards
    Charlie
    You didn't. You tried to use SUMPRODUCT and it doesn't mention SUMPRODUCT on that page. There was amissing bracket in one line of VBA, but that was ll I could find.

  7. #7
    VBAX Expert
    Joined
    May 2006
    Location
    Oklahoma City, OK
    Posts
    532
    Location
    The SUMPRODUCT was one of the formulas I was trying. I was trying various ways that I had found during a Google search. I'm thankful that you found the missing piece of the puzzle.

    Regards
    Charlie

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by coliervile
    The SUMPRODUCT was one of the formulas I was trying. I was trying various ways that I had found during a Google search. I'm thankful that you found the missing piece of the puzzle.

    Regards
    Charlie
    Well, I am the guilty party that wrote it! Actually, I cannot see why the SUMPRODUCT didn't work, it is exactly the technique that I use on another facility, I will need to investigate deeper.

  9. #9
    VBAX Expert
    Joined
    May 2006
    Location
    Oklahoma City, OK
    Posts
    532
    Location
    I didn't realize that you had written it. Well any way I got what I nedded with you help...job well done.

    Charlie

Posting Permissions

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