+ Reply to Thread
Results 1 to 5 of 5

Count Cells Based On A Background Color

  1. #1
    Registered User
    Join Date
    03-13-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    59

    Count Cells Based On A Background Color

    Greetings,

    I am having trouble assembling some code to count the cells that have a background (interior index) of red in the worksheet range("J:AE")

    If anyone could lend me some assistance, I would be very grateful. Thank you in advance.

    Here is what I have developed so far, but it's not working as planned.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Count Cells Based On A Background Color

    Ok try this one

    Please Login or Register  to view this content.
    But it takes too much time to loop...
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    03-13-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    59

    Re: Count Cells Based On A Background Color

    I ran the code with some sample data. However, it came back with a total count of 0, when it should have come back with 4. Any thoughts as to why it might not be detecting or counting the cells with a red background? Thank you your help. I appreciate it.
    Last edited by shg; 04-27-2010 at 11:28 AM. Reason: deleted spurious quote

  4. #4
    Registered User
    Join Date
    03-13-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    59

    Re: Count Cells Based On A Background Color

    Hey Contaminated,

    Never mind my previous post. Found on a mistake on my end. Your code works perfectly. Thank you for your help. I appreciate it greatly.

    Respectfully,

    NSTURK725

  5. #5
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Count Cells Based On A Background Color

    I ran the code with some sample data. However, it came back with a total count of 0, when it should have come back with 4. Any thoughts as to why it might not be detecting or counting the cells with a red background? Thank you your help. I appreciate it.
    It works for me.

    See file HTH
    Attached Files Attached Files

+ 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