PC Review


Reply
Thread Tools Rate Thread

color count...

 
 
okrob
Guest
Posts: n/a
 
      31st Jan 2007
My sub counts the color of cells in the range specified.
I'd like to count the color of cells that are colored with conditional
formating.
Right now, the entire range is set to no fill or some other color, but
upon some entry the conditional formating colors the cell red. I need
to count the red cells.
Conditionally, I have the cells in range hrdata set to red (normally
no fill) and this sub doesn't count them.
I need an explaination, please?

Sub ColorCount()
red = 0
For Each Cell In Sheet2.Range("hrdata")
If Cell.Interior.ColorIndex = 3 Then
red = red + 1
Else
End If
Next
if red > 0 then
MsgBox red
Else
End If
End Sub

Thanks,
Rob

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      31st Jan 2007
Read this article http://xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"okrob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> My sub counts the color of cells in the range specified.
> I'd like to count the color of cells that are colored with conditional
> formating.
> Right now, the entire range is set to no fill or some other color, but
> upon some entry the conditional formating colors the cell red. I need
> to count the red cells.
> Conditionally, I have the cells in range hrdata set to red (normally
> no fill) and this sub doesn't count them.
> I need an explaination, please?
>
> Sub ColorCount()
> red = 0
> For Each Cell In Sheet2.Range("hrdata")
> If Cell.Interior.ColorIndex = 3 Then
> red = red + 1
> Else
> End If
> Next
> if red > 0 then
> MsgBox red
> Else
> End If
> End Sub
>
> Thanks,
> Rob
>



 
Reply With Quote
 
okrob
Guest
Posts: n/a
 
      1st Feb 2007
yeah, I got some of the same info from Chip Pearson's site. I decided
I was going about this all wrong and just did the test with vb like I
did for the conditional format and counted that up. It produced the
same results.
Rob

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count, Sum, and Filter by Color Khalil Microsoft Excel Worksheet Functions 3 19th Jun 2009 05:06 PM
Can you count cells by color? =?Utf-8?B?VE0=?= Microsoft Excel Worksheet Functions 3 6th Sep 2007 12:12 AM
using vba to do a count for color cell =?Utf-8?B?dGlrY2h5ZV9vbGRMZWFybmVyNTc=?= Microsoft Excel Misc 2 12th Apr 2007 02:32 AM
Re: how do i count rows, and count them by color or a highlight? blue. Frank Kabel Microsoft Excel Worksheet Functions 0 9th Sep 2004 10:05 PM
Count by fiil color keith44 Microsoft Excel Programming 9 24th Feb 2004 12:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:11 PM.