Here is an example that takes a color value and converts it to its HTML Hex equivalent. If you want to see a working application that does this with full source code, you can download it from my web page here. Here's the URL in case the link isn't working: http://msnhomepages.talkcity.com/cerfst/jcouture100

Then download the Programmer's Color Converter app and Source Code.

I've been having problems with the URL Processing properly in this forum, so you may have to type in the URL manually. There shouldn't be a space in the url in JCOUTURE100.
Hope this helps.

Code:
Dim getRed As Long
Dim getGreen As Long
Dim getBlue As Long
Dim getColor As Long
Dim TempVal As Long

getColor = 4227327  'Set color variable = to an orange color

'Use integer division to drop any decimal value
'Get value of Blue
getBlue = Format(getColor \ (16 ^ 4), "#00")
    
'Get remainder value after Blue is taken out.
TempVal = getColor Mod (16 ^ 4)
    
'Use integer division to drop any decimal value
'Get value of Green
getGreen = Format(TempVal \ (16 ^ 2), "#00")
    
'Remainder is Red value
getRed = Format(TempVal Mod (16 ^ 2), "#00")
    
strRed = "&H" & Format(Hex(getRed), "#00")
strBlue = "&H" & Format(Hex(getBlue), "#00")
strGreen = "&H" & Format(Hex(getGreen), "#00")
[Edited by jcouture100 on 06-26-2000 at 02:42 PM]