retrieve cell color of conditional formatted cell by colorscale

  • Hello,

    This is my first post in this forum :)

    Well I have an excel range where conditional formatting of colorscale is applied. Highest value becomes red, lowest becomes green and shades in between.

    Now I need to retrieve the color of these cells at a later point. But the color returned is always white.

    Any thoughts how it can be achieved?


  • Try

    Sub ColorByCondFormat()
        Dim i As Long
        'Assumes conditional formatting applied to A1
        i = Cells(1, 1).DisplayFormat.Interior.ColorIndex
    End Sub

    If I've been helpful, let me know. If I haven't, let me know that too. 

  • Hi dangelor,

    I tried your suggestion.

    Getting colors back but all are shades of red and yellow. Where it was white, it is magenta now.

    Any further idea?

    Also argb hex code is getting retrieved.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!