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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top