Excel Convert HEX To RGB

Excel VBA Convert HEX To RGB With Userform


          Hexadecimal(Hex) color codes frequently are used in web designing (HTML-CSS etc.) .
In Excel, the RGB and HLS color codes  are used. Therefore, it is necessary to convert Hex values to RGB or HLS.

          For example,consider we have a hexadecimal code for a cell background color in Excel ; #FF8800 . This code corresponds to orange color.When we convert this code to rgb with userform that we created, the result is RGB(255,136,0). So, we can use the color code as Rgb in Excel and VBA.

For example : Sheets("Page-1").Range("f11").Interior.Color = RGB(255, 136, 0)
                       TextBox1.BackColor = RGB(255, 136, 0)

excel hex to rgb


convert hex to rgb

No comments:

Post a Comment