View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Matthew Dyer Matthew Dyer is offline
external usenet poster
 
Posts: 178
Default cells.interior.color values

On May 20, 10:07*pm, isabelle wrote:
sorry I forgot to include the method for applying this color
and select a cell with a color before you run the macro

Sub test()
TheColor = ActiveCell.Interior.Color

Red = Int(TheColor Mod 256)
Green = Int((TheColor Mod 65536) / 256)
Blue = Int(TheColor / 65536)

MsgBox "Color " & TheColor & Chr(10) & _
"RED : " & Red & Chr(10) & _
"GREEN : " & Green & Chr(10) & _
"BLUE : " & Blue

ActiveCell.Offset(, 1).Interior.Color = RGB(Red, Green, Blue)

End Sub

--
isabelle


Thanks isabelle. That code is most excellent!