rgb

  • Thread starter Thread starter June
  • Start date Start date
June,

Here is a function, and an example test

Public Function GetRGB(colour As Long, ByRef red, ByRef green, ByRef blue)

red = colour And &HFF
green = colour \ 256 And &HFF
blue = colour \ 256 ^ 2 And &HFF

End Function


Sub test()
Dim vRed, vGreen, vBlue

GetRGB ActiveCell.Interior.Color, vRed, vGreen, vBlue
Debug.Print vRed, vGreen, vBlue

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Thanks Bob

Bob Phillips said:
June,

Here is a function, and an example test

Public Function GetRGB(colour As Long, ByRef red, ByRef green, ByRef blue)

red = colour And &HFF
green = colour \ 256 And &HFF
blue = colour \ 256 ^ 2 And &HFF

End Function


Sub test()
Dim vRed, vGreen, vBlue

GetRGB ActiveCell.Interior.Color, vRed, vGreen, vBlue
Debug.Print vRed, vGreen, vBlue

End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top