الإجابة Backward conversion from RGB to Excel colorindex i.e. 56 colors

  • Wednesday, December 17, 2008 6:22 PM
     
     
    Hi,

    I want to convert RGB color value to Excel colorindex which is 56 color based. First I thought that RGB provides backward conversion. Can you help me how I can get backward compatibility from RGB to 56 colors.

    Regards
    Ahmad

All Replies

  • Thursday, December 18, 2008 9:46 AM
     
     Answered

        I found a way to do it.

        Cells( 1, 1).Interior.Color = RGB(255, 101, 50)
        Cells( 1, 1).Value = Cells( 1, 1).Interior.ColorIndex

        Cells( 1, 1).Value will display the ColorIndex between 0 - 56