Is there, in Excel, a Formula that retrieve the ColorIndex (or RGB) of a cell?
I found the follwing function:
CELL(info_type, the_cell)
The following function will display the RGB value of a selected cell.
Function CellColorValue(CellLocation As Range)
Dim sColor As String
Application.Volatile
'Retrieve hex value into string sColor
sColor = Right("000000" & Hex(CellLocation.Interior.Color), 6)
'Return the string Version e.g. 255,255,255 RGB color value found in
'Excel cell. Use in built worksheet function to convert Hex to Decimal
'Use string function to separate Hex string into three parts
CellColorValue = Application.WorksheetFunction.Hex2Dec(Right(sColor, 2)) & "," & application.WorksheetFunction.Hex2Dec(Mid(sColor, 3, 2)) & "," & Application.WorksheetFunction.Hex2Dec(Left(sColor, 2))
End Function