'アクティブセルの背景色の色コードを確認する
Sub Chenk_Colorindex()

    Dim R As Long
    Dim G As Long
    Dim B As Long
    Dim Color As Long
    Dim RGB

    Color = ActiveCell.Interior.Color

    R = Color Mod 256
    G = Int(Color / 256) Mod 256
    B = Int(Color / 256 / 256)

    '10進数
    RGB = "RGB(" & R & ", " & G & ", " & B & ")"
    MsgBox RGB

    '16進数
    MsgBox "#" & Right("0" & Hex(R), 2) & _
        Right("0" & Hex(G), 2) & _
        Right("0" & Hex(B), 2)

End Sub