Ok, I was trying something else and started chasing rabbits.

(above from the Help files:)

So, in a DT I want to reverse this formula and solve for R, G and B.

I found this post somewhere when I googled.

So, for R I have

=MOD(256,B3) (where cell B3 is the Integer for the color)

So, for G I have

=MOD(256,(B3/256)) (where cell B3 is the Integer for the color)

So, for B I have

=MOD(256,(B3/256/256)) (where cell B3 is the Integer for the color)

with the following results.

I know SW flips these values around all day long behind the scenes. I'm not into API and just wanted to get this DT to function like I want.

Any thoguhts or solution for getting the equations right is appreciated.

Thanks in advance.

Alan

1. Excel arguments for MOD are backwards.

2. The VB code you posted uses integer division, which truncates (not rounds) any decimal. Note \ vs. /.

Formula for Blue (assuming value is in A5 of course):

=MOD(TRUNC(TRUNC(A5/256,0)/256,0),256)