How many rows are coloured

M

Moideen

Hai,

Please help me to get count rows of coloured.

Data Having 125 Rows, Row No : 50 and Row No : 75 are coloured wit
blue

Need MSG on Row1 "2 Rows are colored" is there any function in exce
2007 for this
 
V

Vacuum Sealed

Hai,

Please help me to get count rows of coloured.

Data Having 125 Rows, Row No : 50 and Row No : 75 are coloured with
blue

Need MSG on Row1 "2 Rows are colored" is there any function in excel
2007 for this.

Hi

There is most likely a better code out there, I have seen one, just
can't locate it, that said! I have tested the below and it does the job
well ( assuming you are using the standard Blue = 12611584 ).

Record a Macro and change a cell to your desired color and change the
code to reflect.

Sub CountColor()

Dim tCell As Range 'Total colored Cells
Dim hRng As Range 'Helper Count Range
Dim myRng As Range 'Range of Column A
Dim c As Range

Set tCell = [A1] 'Displays Total color Cells
Set hRng = Range("B2:B10") '**Change Range to suit
Set myRng = Range("A2:A10") 'Change Range to suit

For Each c In myRng
If c.Interior.Color = 12611584 Then
c.Offset(0, 1).Value = 1 '**Change number of Columns to offset
End If
Next c

tCell = WorksheetFunction.Sum(hRng) & " Cells are Colored"

End Sub

HTH
Mick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top