Count colored cell on excel automatically

0 votes

I'm trying to count the number of cells based on colors, currently using a VBA code that already does it. But it doesnt update automatically and I will have to manually keep refreshing it. Any way to fix this?

Thank you!!

Current VBA code:

Function CountCellColor(CountRange As Range, CountColor As Range)
Dim Color As Integer
Dim Total As Integer
Color = CountColor.Interior.ColorIndex
Set rCell = CountRange
For Each rCell In CountRange
If rCell.Interior.ColorIndex = Color Then
Total = Total + 1
End If
Next rCell
CountCellColor = Total
End Function

Mar 25, 2022 in Database by Edureka
• 13,690 points
1,613 views

1 answer to this question.

0 votes
Use Filter and SUBTOTAL to Count Colored Cells
Use the following formula in any cell below the data set: =SUBTOTAL(102,E1:E20)
Choose the headers.
Filter may be found under Data –> Sort and Filter –> Filter. A filter will be applied to all of the headers as a result of this.
Any of the filter drop-downs can be selected by clicking on it.
Select the colour from the 'Filter by Color' menu.
answered Mar 30, 2022 by gaurav
• 23,580 points

Related Questions In Database

0 votes
1 answer

How do I enable Oracle automatically on systemboot?

To enable the database service to start ...READ MORE

answered Oct 5, 2018 in Database by Frankie
• 9,830 points
1,329 views
0 votes
1 answer
0 votes
1 answer

How to count distinct values in Excel

Use functions to count the number of ...READ MORE

answered Mar 15, 2022 in Database by gaurav
• 23,580 points
2,051 views
0 votes
1 answer

Prevent cell numbers from incrementing in a formula in Excel

In Excel, you can use a feature ...READ MORE

answered Mar 15, 2022 in Database by gaurav
• 23,580 points
16,771 views
0 votes
1 answer

How to get the "Name Box" name of an Excel cell?

By typing in the Name Box, you ...READ MORE

answered Mar 15, 2022 in Database by gaurav
• 23,580 points
7,551 views
0 votes
1 answer

Excel Reference To Current Cell

Create a formula with the name THIS ...READ MORE

answered Mar 25, 2022 in Database by gaurav
• 23,580 points
12,016 views
0 votes
1 answer
0 votes
1 answer

Convert Number to Words in Excel VBA code

1. Prevent the conversion of the cents ...READ MORE

answered Dec 30, 2022 in Database by bobh

edited Mar 5, 2025 56,949 views
0 votes
0 answers

Count colored cell on excel automatically

I'm trying to count the number of ...READ MORE

Mar 28, 2022 in Database by Edureka
• 13,690 points
760 views
0 votes
1 answer

How do you count if a cell contains partial text in Excel?

With Formulas, Countif Partial String/Substring Match We can ...READ MORE

answered Mar 30, 2022 in Database by gaurav
• 23,580 points
26,578 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP