Calculate number of cells colored red
Closed
Spense
-
28 Oct 2009 à 19:19
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 28 Oct 2009 à 21:37
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 28 Oct 2009 à 21:37
Related:
- Calculate number of cells colored red
- Pokemon fire red cheats - Guide
- Pcdj red - Download - Audio playback
- Formula to calculate vat in excel - Guide
- Based on the cell values in cells b77 ✓ - Excel Forum
- Hp desktop red light flashing 4 times - Hardware Forum
1 response
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
28 Oct 2009 à 21:37
28 Oct 2009 à 21:37
try this macro
Sub test()
Dim r As Range, c As Range, j As Integer, m As Integer
Set r = Range(Range("A1"), Range("A1").End(xlDown))
For Each c In r
If c.Interior.ColorIndex <> -4142 Then
j = c.Interior.ColorIndex
MsgBox j
GoTo exitloop
End If
Next c
exitloop:
m = 0
For Each c In r
If c.Interior.ColorIndex = j Then m = m + 1
Next c
MsgBox "count of cell in color " & j & " is " & m
End Sub