Get RGB color ?

  • Thread starter Thread starter SpookiePower
  • Start date Start date
S

SpookiePower

I have found a color in the color palette that I will use to color some cells.
But how do I find the RGB numbers for the color so I can use it in VBA ?
 
Color a cell manually and query the interior.color property.

? activecell.Interior.Color
 
SpookiePower:

try, Get Activecell.Interior.Color

Dim R As Integer
Dim G As Integer
Dim B As Integer
Dim RGB As Long
RGB = ActiveCell.Interior.Color
R = RGB And 255
G = RGB \ 256 And 255
B = RGB \ 256 ^ 2 And 255
GetRGB = R & "," & G & "," & B
MsgBox GetRGB
 
Back
Top