Automatic Hex to RGB Conversion VBA Macro

Hello,

For my internship, I have to create an excel macro to convert a color value in hexa code to rgb and vice versa.

I have already done a lot of research on google and in general I find excel formulas (use of boxes in the formulas to convert) instead of a VBA code. In addition, it takes usually 2 tables, one from hex to rgb and another from rgb to hex.

But I'm looking for an automatic conversion, that is to say to make a modification of the hex value, the rgb value is updated and vice versa, all in the same table.

All these data are organized by columns and you need a third one to display the corresponding color.

For the moment I have fulfilled my specifications but it is not optimal, I have indeed two tables. I call for your help today to help me to optimize my code.

Tell me if it's not clear haha, I did the best I could. I put in attachment the excel file as is.

Thanks in advance !

11book4-3.xlsm (49.37 Ko)

Hi ! Lisa Nguyen,

Here, your Excel File is back, with automatic conversion.

If you agree, you can display the corresponding color with your VBA Module3. Sub RGB_TO_HEX_COLOR()

See my Note in Sheet1.

Breaking News,

Excel File Version2 is coming Now.

Best Regards.

Wow really thanks for what you did! I saw the message you left on the excel file!

I will now try to analyze and understand what you have written in the code.

Thank you again and if you manage to switch from RGB to HEX it would be amazing !

Rechercher des sujets similaires à "automatic hex rgb conversion vba macro"