Related:
- Increment cell value according to cell colour
- Crimping colour code - Guide
- Conditional formatting if cell contains text - Excel Forum
- If cell contains date then return value - Excel Forum
- Count if cell contains number - Excel Forum
- If cell A1 has text then cell B2 has today's Date ✓ - Excel Forum
4 responses
Do not use a color to determine the displayed result, but use the value. The only "resource" that cares about the color is a HUMAN! What value in the cell determines the color, and check for the internal value of the cell, not the color!
Thank you ac3mark, but this doesn't answer my question, please treat me as a complete excel dummy. :)
No problems!
What determines the colors? A number? Check the value of the cell, not the color.
So where you use: c.Interior.ColorIndex, change that to validate a value, instead of some color index. Something like:
if c.value =.05 then Countcolour = Countcolour + 1
if c.value =1 then Countcolour = Countcolour + .05
Initialize variables that are equal to the color name, if you have to use the color index(in that case, this sounds like homework, at which I say I don't do homework!)
What determines the colors? A number? Check the value of the cell, not the color.
So where you use: c.Interior.ColorIndex, change that to validate a value, instead of some color index. Something like:
if c.value =.05 then Countcolour = Countcolour + 1
if c.value =1 then Countcolour = Countcolour + .05
Initialize variables that are equal to the color name, if you have to use the color index(in that case, this sounds like homework, at which I say I don't do homework!)