Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default color count...

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default color count...

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" wrote in message
oups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default color count...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count, Sum, and Filter by Color Khalil[_2_] Excel Worksheet Functions 3 June 19th 09 05:06 PM
Can you count cells by color? TM Excel Worksheet Functions 3 September 6th 07 12:12 AM
Count cells with the red color Collcat Excel Worksheet Functions 1 October 27th 04 07:04 PM
Count cells with the red color Collcat Excel Worksheet Functions 1 October 27th 04 05:26 PM
countif color count lyriquid Excel Programming 16 April 7th 04 03:31 PM


All times are GMT +1. The time now is 08:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"