Change Background using Color Index When Value In Column Changes

  • Hello Excel Gurus,


    Can you please help update this so that it uses a random different color in the color index each time the value changes? The way it is working now is that it alternates between gray to white. I am trying to make it change to a different color every time the value changes all the way down a column.


    This works except for the color index:


    Thank you very much.


    Mavlon

  • Change

    Code
    .ColorIndex = 15

    to

    Code
    .ColorIndex = Application.RandBetween(1, 56)

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Hi KjBox,


    I made the change to .ColorIndex = Application.RandBetween(1, 56) but it changed the colors when the part number was the same and then skipped a number leaving it with a white background for next number and then continues with multicolor for next part number etc..



    Column A was the result. I edited Column B to show what I am trying to achieve:


    Thank you for your help.


    Kind regards,

    Mavlon

  • Attach your workbook, we cannot work with an image

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Hi KjBox,


    Oops I forgot to edit it to the last revision I used:



    Kind regards,

    Mavlon

Participate now!

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