Excel: Coloring column cells based on values


Hi team, I need a macro that fill or not fill color (grey) to the cells of two adjacent columns based on change in values of the second column. Please see the example below. Here both cells in a row are either filled or not filled(including the numbered one).

grey color 1
grey color 1
no color 2
no color 2
no color 2
grey color 3
grey color 3
no color 4
Also, I need second macro that work opposite to the above macro. Means, based on the color filled or not filled it assigns number in the previous column. see example below.
1 grey filled
2 no fill
2 no fill
3 grey filled
3 grey filled
3 grey filled
4 no fill
5 grey filled
Help appreciated! Thanks Deepk


This question generated 10 answers. To proceed to the answers, click here.

This thread is current as of March 23, 2018.


For more resources for Microsoft Excel