Color conversion

A

androo...

In code how do I convert an RGB value to Words own color value (MsoRGBType)?

That is convert RGB(12, 106, 182) to 11954700 and back again.

Thanks,
androoooooooooooooooooo........................
 
T

Tony Jollans

To convert a triple to anumber use the built-in RGB function ...

MsgBox RGB(12, 106, 182)

To do it the other way requires arithmetic. It's not much use as a string
but this gives you the calculation ..

RGBNum = 11954700
MsgBox RGBNum Mod 256 & ", " & (RGBNum \ 256) Mod 256 & ", " & RGBNum \ 256
^ 2
 
Top