+ Reply to Thread
Results 1 to 2 of 2

Macro to count cells with conditional formatting in place

  1. #1
    Forum Contributor
    Join Date
    04-17-2012
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    122

    Question Macro to count cells with conditional formatting in place

    Good Afternoon

    I have the following code added to my workbook that allows a count to take place if someone manualy colours a cell (they do this to represent a late start), I have ammended this to automatically lookup the start time against what time they were meant to start and if they are late then I have conditional formating via a formula to colour the cell.

    Please Login or Register  to view this content.
    I guess because the user is not causing an event to take place the count element is not working, Is there a way to ammend the code to work for conditionaly formated cells.

    I have this formula in place to call the code above:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Macro to count cells with conditional formatting in place

    The attribute ColorIndex is the base fill color set for the cell. It does not change if the fill color is changed by conditional formatting.

    The only way I know how to do what you want (and I will say up front that there may be another way) is to use the same conditions in your code that are used by conditional formatting to change the fill color. You will have to extract the condition for the desired cell from the conditional formatting formulas, or hard code it.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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