A much better answer (in terms of clarity) is this:
'Convert RGB to LONG:
LONG = B * 65536 + G * 256 + R
'Convert LONG to RGB:
B = LONG \ 65536
G = (LONG - B * 65536) \ 256
R = LONG - B * 65536 - G * 256
LONG is your long integer (decimal) that you want to make.
Easy huh?
Sure, bitshift