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,135 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,260 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
736 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,260 points
10,600 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,260 points
5,417 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,260 points
10,708 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Convert numbers to words in Excel (VBA)

In the cell where you wish to ...READ MORE

answered Mar 25, 2022 in Database by gaurav
• 23,260 points
29,938 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
349 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,260 points
1,422 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