Search : in
By :

Calculate number of cells colored red

Last answer on Oct 29, 2009 1:37:07 am GMT Spense, on Oct 28, 2009 11:19:39 pm GMT 
 Report this message to moderators

Hello,
Can someone help me calculate a formula to calculate number of cells that are a certain color?

Thanks,

Configuration: Windows XP Internet Explorer 6.0

Best answers for « calculate number of cells colored red » in :
Colouring cells on conditions ShowColouring cells on conditions There are many pratical functions under Excel which is not commonly used. Example: If you wish a cell automatically turns red (or other formatting border, frame etc) under one condition: a result, a...
[VBA] A function that returns the color of an active MFC Show[VBA] A function that returns the color of an active MFC This function returns the value of the active format in conditional formatting. With the function below, two values can be returned. Mode = 0: the value of Interior.ColorIndex...
VB6 Finding the RGB values of a color ShowVB6 Finding the RGB values of a color Dim R as integer Dim G as integer Dim B as integer Sub FindRGB(Col As Long) R = &HFF& And Col G = (&HFF00& And Col ) \ 256 B = (&HFF0000 And Col ) \ 65536 End Sub Note: Here...
Download USA Unlisted Cell Phone Numbers ShowHas you friend flown for America without telling you where he/she would settle? Don’t panic! USA Unlisted Cell Phone Numbers is a program which can help you. By using this program, you simply need to know his/her phone number in order to find...
Download Random Number Generator Pro ShowRandom Number Generator Pro is a very simple tool to generate a random number list. There are several combinations and you can define the randomization criteria. You simply select the lower and upper limits as well as the number increments and the...
Download The Love Calculator ShowLove is a big word, then all means are good to find it. The name of each can say about it on compatibility between two persons a lot. The Love Calculator is a program which counting affinity between two individuals. It is not a precise science,...
Worksheet - Cells ShowThe Concept of a Cell A "cell" is the intersection between a line (horizontal) and a column (vertical) on a worksheet. Thus, the name of the line combined with the name of the column gives the cell's coordinates (the term address is sometimes also...
Spreadsheet - Formulas ShowIntroduction to Formulas The main use of a spreadsheet is to automate calculations, which means using cells to perform operations based on values in other cells. The spreadsheet recalculates all the values each time a change is made to the value of...

1

 venkat1926, on Oct 29, 2009 1:37:07 am GMT

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

Reply to venkat1926