There is no excel formula to get the color of the cell, and no to set the color of the other.
However, you can make a function to get the color of a specific cell - or, as in my example, the color of the function's cell:
Public Function GetColor() Dim rng As Range If TypeName(Application.Caller) = "Range" Then Set rng = Application.Caller End If GetColor = rng.Cells.Interior.Color End Function
Now you may think, okay, then I change this, just to set the color too. But no - that doesn't work. To change the color of the cells, you will need to use the Worksheet_Change event and set each cell to a long value inside them as a color.
Target.Interior.Color = Target.Value
There would be a line for this when using Worksheet_Change .
Of course you can use ColorIndex - just adapt accordingly.
source share