Count number of rows NOT filled with color and provide message box popup

ChrisOK

Well-known Member
Joined
Mar 26, 2003
Messages
601
Need to provide a count to the analyst: Number of NON-Colored Rows (these are our primaries) and we have to record it on an activity report.
Looking for VBA that will start at ROW 5 and count downward any rows that have been highlighted....
Actually, the count could simply count any colored rows in COL A as it is always highlighted as part of the row...

Then provide a pop up message: "Number of Non-Colorized Rows = 3075"
With an OK button to dismiss it. Hopefully, this is not hard to achieve?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
How about this:
Code:
Sub macro()
q = 0
For Each x In Range(Cells(5, 1), Cells(Rows.Count, 1).End(xlUp))
If x.Interior.Color <> 16777215 Then q = q + 1
Next x
MsgBox ("Number of Non-Colorized Rows = " & q)
End Sub
It counts cells in column A, starting with A5, that have data but are not highlighted.
 
Upvote 0
OMG >that< is the coolest! LOVE IT!
Thanks! You're awesome!

I'll click "LIKE" on your post to help you out!
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,542
Members
449,316
Latest member
sravya

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