Home > Excel Tutorial > Convert HEX(Hexadecimal) Values To RGB Color Codes

Convert HEX(Hexadecimal) Values To RGB Color Codes

Hexadecimal(Hex) color codes are used in web designing (HTML-CSS etc.) .In Excel Program, 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 ; #FF6600 . This code corresponds to orange color.When we convert this code to rgb with userform that we created, the result is RGB(255,102,0). So, we can use the color code as Rgb in Excel and Vba.

For example : “Sheets(“Page-1”).Range(“C2”).Interior.Color = RGB(255, 102, 0)
                           TextBox1.BackColor = RGB(255, 102, 0)

Download Example Workbook

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: