Change a cell content according with the color of another cell

[Closed]
Report
-
 Blocked Profile -
Hello,
I´m using Excel and need to change the VALUE of a cell (need to appear "-") if the COLOR of another cell is PURPLE.
After digging around with conditional formatting, I'm looking the IF function but I can´t find wich property I could use to give me the color of a cell.
Any help is wellcome!
Thanks in advance!

PS: I´ll post back if I manage to work it out!...

PS2: There is a property called "Cell" wich has a "color" code but still isn't giving me what I need...

1 reply

That Cell is a function, and in this case, "the value 1 if the cell is formatted in color for negative values; otherwise returns 0 (zero)."

You can write a user defined function in such a manner...
press Alt-F11, and Insert New Module

In that module define a new function such as:
Function ColorN(Cell_Color As Range)  
ColorN = Cell_Color.Interior.ColorIndex  
End Function


Now in the cell(A1) that you want to see what the color is type in
=ColorN(B4)

And if B4 is Purple, that cell will display the index of purple .

Now Change your cell Into a "-" based on a value in A1.

I hope this helps!

Have FUN!


It's kind of fun to do the impossible! -Walter Elias Disney