VBA code for counting occurrence by month from colored cells

  • Hello Excell masters,


    I am looking for VBA code to count occurences in a month from colored cells. Red color for negative visits for different dates, Green colors for positive visits for different dates.Need VBA for counting cells by color in different months. For example results for positive visits for September in one cell and results for negative visits for September in a different cell. Thank you

  • Welcome to the forum!


    On your 5th post you will be able to attach a file.


    Meanwhile, you can try explaining in more detail. e.g.
    September is for this year in column B from row 2 and down. Column B are all dates. The color green is from a conditional format for interior color. Or you might say that green is manually set interior color, or green is font color manually set or set by conditional format.


    Or, try some routines by Chip Pearson. http://www.cpearson.com/excel/colors.aspx

  • Hello and Welcome to the Forum :smile:


    Should you have all your negative values in Red and all your positive ones in Green ... you could forget the colors and simply go counting Positives and Negatives ...with Sumproduct ...


    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Following your private message ...


    The most important thing is to explicit the Rules you are using to determine Positive vs Negative ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)