Sub ColorToRGB() Dim OriginalColor As Double Dim ConvertedColor As String OriginalColor = 16367431 ConvertedColor = (OriginalColor Mod 256) & ", " & ((OriginalColor \ 256) Mod 256) & ", " & (OriginalColor \ 65536) Mod 256 End Sub
Sub MyColor() Dim MyRng As Range Dim ActCell As Range Set MyRng = Range("A2:A7") For Each ActCell In MyRng 'Color ActCell.Offset(0, 2).Value = ActCell.Interior.Color 'ColorIndex ActCell.Offset(0, 3).Value = ActCell.Interior.ColorIndex Next ActCell End Sub
If Cells(1, 1).Interior.Color <> 16367431 Then Cells(1, 1).Interior.Color = 16367431
If .Interior.Color <> 16367431 Then .Interior.Color = 16367431
Sub a() MsgBox ActiveCell.Interior.ColorIndex MsgBox ActiveCell.Interior.Color End if