counting red cells

chris2727272727

Board Regular
Joined
Jul 10, 2005
Messages
152
i have a large range of data but some of the cells are red i want a cell at the bottom olf the data to calculate the number of red cells in the sheet.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Welcome To The board

I'm sure that one of the true Gurus on this board will be able to come up with a more eloquent way of doing this but...

If your data isn't too large, you could use a macro to store a count of cells formatted with red text something like this. It assumes your data begins in a1 and there are no blank cells in your data range:

Code:
Dim Count_Red As Integer
Sub findred()
Count_Red = 0
Range("a1").Select
Do Until ActiveCell.Value = ""
If ActiveCell.Font.Color = vbRed Then
Count_Red = Count_Red + 1
End If
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Value = Count_Red
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,521
Messages
6,120,018
Members
448,937
Latest member
BeerMan23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top