Excel: setting the color of a cell based upon a value

microsoft excel

Is it possible to set the color of a cell based upon a hex string (e.g., "RRGGBB") or a numeric value and if so how? I have a sheet that converts colors that are stored in BGR format to RGB. I would like would to set the cell color next to the converted RGB value.

Best Answer

You have to use VBA to accomplish your goal. Feel free to modify the routine below, which colors the background of the current cell, according to your needs.

Sub ColorGrey()
    ActiveCell.Interior.Color = RGB(100, 100, 100)
End sub
Related Question