brothertruffle880
asked on
Excel 2013 VBA - How to use hex digits to color the interior of a cell.
How can I use hex digits to color the interior of a cell.
I'm trying to use this chart
http://dmcritchie.mvps.org/excel/colors.htm
using this syntax
Range("c1:c20").Interior.C olor = &H222222
but I'm doing something wrong!
Help!
I'm trying to use this chart
http://dmcritchie.mvps.org/excel/colors.htm
using this syntax
Range("c1:c20").Interior.C
but I'm doing something wrong!
Help!
'&H222222' isn't a Hex colour code. What colour are you after?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You do not "need" to convert that value. The function only makes it more user-friendly to use HEX colour values. If you record a macro and change the colour you will see that it will work just fine with integer colour value.
ASKER
Thanks everyone! Great insights on using that option.
I feel like I took a college class in color.
I feel like I took a college class in color.
You are welcome!
your code turns cells C1 to C2 in black... (at least in my excel)... Is that not what you want?