Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count the number of times a cell is colored with conditional formatting
I have been trying to figure out how to count the number of times a cel is colored using conditional formatting. I have looked through the old threads and still cannot find solution. I need to add up the # of times a cell is a certain color (Green) in particular row. However, the criteria for the cell to become green is different fro row to row. In most of the rows, there is only one condition whic highlights the cell green; it is left blank if it doesn't satisfy thi condition. In others, there are two conditions: one that highlight green and one that highlights red. I need to add up the number o green and red in the row. I have done searches on this topic before and was pointed to a websit which tries to explain a VBA code for this. However, I cannot make heads or tails of this. If anyone could help, I would greatly appreciate any suggestions. Thanks. DrSues0 -- DrSues0 ----------------------------------------------------------------------- DrSues02's Profile: http://www.excelforum.com/member.php...fo&userid=1256 View this thread: http://www.excelforum.com/showthread.php?threadid=27070 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count the number of times a cell is colored with conditional formatting
If it is colored by conditional formatting, the only way to count them is to
use a formula with the same logic that you used to set the color. On Tue, 19 Oct 2004 21:56:07 -0500, DrSues02 wrote: I have been trying to figure out how to count the number of times a cell is colored using conditional formatting. I have looked through the old threads and still cannot find a solution. I need to add up the # of times a cell is a certain color (Green) in a particular row. However, the criteria for the cell to become green is different from row to row. In most of the rows, there is only one condition which highlights the cell green; it is left blank if it doesn't satisfy this condition. In others, there are two conditions: one that highlights green and one that highlights red. I need to add up the number of green and red in the row. I have done searches on this topic before and was pointed to a website which tries to explain a VBA code for this. However, I cannot make heads or tails of this. If anyone could help, I would greatly appreciate any suggestions. Thanks. DrSues02 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count the number of times a cell is colored with conditional formatting
Your best bet would be to use ...Interior.ColorIndex
For example 4 and 10 are two basic shades of green. You just have to make a loop that goes through every cell and looks for the color/colors youre after. DrSues02 wrote in message ... I have been trying to figure out how to count the number of times a cell is colored using conditional formatting. I have looked through the old threads and still cannot find a solution. I need to add up the # of times a cell is a certain color (Green) in a particular row. However, the criteria for the cell to become green is different from row to row. In most of the rows, there is only one condition which highlights the cell green; it is left blank if it doesn't satisfy this condition. In others, there are two conditions: one that highlights green and one that highlights red. I need to add up the number of green and red in the row. I have done searches on this topic before and was pointed to a website which tries to explain a VBA code for this. However, I cannot make heads or tails of this. If anyone could help, I would greatly appreciate any suggestions. Thanks. DrSues02 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count the number of times a cell is colored with conditional formatting
forgot something...
If Youre looking for green cells (conditional formatting) which dont have a interior.colorindex of green then You cant use what I just posted. You can put the same functionality that the conditional formatting does into your code and looking the other way if that particular Cell is green to your macro or not. Like if the conditional formatting triggers on even numbers You just check in the code whether the cell in question is even (green) or not. And then add it to the totals combined with the "really green" cells :) Cheers, LM DrSues02 wrote in message ... I have been trying to figure out how to count the number of times a cell is colored using conditional formatting. I have looked through the old threads and still cannot find a solution. I need to add up the # of times a cell is a certain color (Green) in a particular row. However, the criteria for the cell to become green is different from row to row. In most of the rows, there is only one condition which highlights the cell green; it is left blank if it doesn't satisfy this condition. In others, there are two conditions: one that highlights green and one that highlights red. I need to add up the number of green and red in the row. I have done searches on this topic before and was pointed to a website which tries to explain a VBA code for this. However, I cannot make heads or tails of this. If anyone could help, I would greatly appreciate any suggestions. Thanks. DrSues02 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count the number of times a cell in a column is shaded green | Excel Discussion (Misc queries) | |||
Is there a way to count the number of different colored cells? | Excel Worksheet Functions | |||
Count the number of times a cell value is within a specific range | Excel Worksheet Functions | |||
How do I count the number of times a letter is used in a cell? | Excel Discussion (Misc queries) | |||
Count number of times a specific number is displayed in a cell ran | Excel Worksheet Functions |