Excel Count Conditional Formatting Colours

preview_player
Показать описание
How To Count Cells By Colors With Conditional Formatting In Excel || How To Count Coloured Cells

Watch this video to understand how to How To Count Cells By Colors With Conditional Formatting In Excel

VBA code:

Button:
Private Sub Refresh_Click()

'Team 1
Call CountColorCellsAQ3

End Sub

Private Sub CountColorCellsAQ3()
'Variable declaration
Dim rng As Range
Dim lColorCounter As Long
Dim rngCell As Range
'Set the range of cells to count
Set rng = Sheet2.Range("U3:AL3")
'loop throught each cell in the range
For Each rngCell In rng
'Checking Red color
If Cells(rngCell.Row, rngCell.Column).DisplayFormat.Interior.Color = RGB(255, 153, 153) Then
lColorCounter = lColorCounter + 1
End If
Next
'Display the total number of red cells in cell listed below
Sheet2.Range("AQ3") = lColorCounter

End Sub

--------------------------------
Рекомендации по теме
Комментарии
Автор

thank you bro... the only video showing the code runs on my expectation of the assignment. this video deserves to have millions of views.

cuongnguyenhuu
Автор

Please give a copy of your file. What fromula did you use in Cell AQ3. Thanks for the reply.

noelcamba
Автор

Ok so this is exactly what i am looking for to be able to count errors on several different Sheets. My errors are highlighted with conditional format colors. I want to put together a count of how many errors exist on any given sheet by using this method. But i can not get it to work as you do not give enough formula information about the cells containg the results. What formula do i put into my cell that will display the results? I would love to have some more detailed information about this please. AMAZING WORK by the way..

jrmanning
Автор

This is really excellent, but I'm having trouble getting it to work. Is this dependent on having a refresh button?

MrBrianb
Автор

Hi -- I have the code working but when I hit the refresh button nothing changes.

cyndilortan
Автор

Can we make it as user defined function

ahmeddef
Автор

Please send me a copy of your file. Thnak you.

noelcamba