Avatar of Jase Alexander
Jase Alexander
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Excel VBA ? Counting red coloured cells under headings and extracting them against date / month

Hi Experts

Hope you can help although I’m not sure if what I’m looking for is possible

I had some excellent assistance with this from the experts and submitted this report with a basic summary however what is required is a little more challenging

I believed using the Colorfunction () online VBA module would solve my issue of counting the coloured cells and it has for the transport summary however what is required is to devise a monthly breakdown per sheet.

This requires some modification to the code to be able to count the number of red cells against each heading (or Columns F to M) but also against the corresponding dates so it provides a count, per month, of the red cells, per heading, to the right of the main sheet

I’ve provided an example on the Air tab, I have manually entered the data in the summary to the right to show the desired results

Is this possible? I’ve tried consolidating some examples I discovered on line using the SUMPRODUCT function, but I haven’t found a suitable solution

Your suggestions would be very welcome
J
EE-Example.xlsm
VBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Jase Alexander

8/22/2022 - Mon
Ejgil Hedegaard

Here are 2 ways to do it.

On sheet Air the count is done with a VBA function, checking the dates and colors.
The values in T1:AE1 are changed to dates, so the dates in column D can be compared to that.
Then formatted to show Jan, Feb etc.
The year is in S1, with the color to count.

On sheet Air (2) the count is with a SUMPRODUCT function.
The values to count are in columns F:M, where 1 is green, and 2 is red.
The color in the cells are done by conditional formatting, both cell and text, so the value is not visible in the cell, see the formula line.
I think typing 1 or 2 is easier than changing the color of the cell,
And then the calculation is with standard formulas.
EE-Example-Count-colour.xlsm
ASKER CERTIFIED SOLUTION
Sam Jacobs

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jase Alexander

ASKER
HI Both

Thank you so much for your response to this I cant tell you how much I appreciate your help

I learn so much from you guys

Regards
Jase
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy