HEX/RGB color value to &H conversion

  • Thread starter Thread starter AA Arens
  • Start date Start date
A

AA Arens

I know the HEX and RGB value of a code, but do not know the &H...
value. Anybode knows a converison tool on the web, or what is the VB
code. I want to fill it as color value for the backgroundcolor of a
command button.

Bart
 
Bart, not sure but the addin here
http://www.andrewsexceltips.com/my_utilities.htm will make a sheet showing
the colors and Color Index ,HTML Colors, RGB Index, Color Name you may want
to give it a try and see if that is what you are looking for, when you
install it, look under other unities # 19


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
I'm not clear what you're after. What is the "H&" value you're looking for?
"&H" is used to indicate a hex value.

Dim L As Long
L = &HA
Debug.Print L 'display 10


If you want to get the hex representation of a number, use something like

Dim HexString As String
Dim L As Long
L = 255 * 256&
HexString = Hex(L)
' OR
HexString = "H&" & Hex(L)
Debug.Print HexString


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
 

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

Back
Top