Hey All,

I have a certain problem, that I want to solve, but this is a bit challanging for me. So, the basic thing is that I work with a list of around 2k rows every week, with different IDs for the rows. Each row is for a material that is missing for a certain machine. Since this changes every day, every time i get a new list, the numbers change, depending on Mashine ID and number of material count. So basically, it can happen, that first day I get 5 different machine IDs with 3,12,5,7,8 material numbers, respectively, then Next day I get 2 machines with 23 and 67 materials. So first day 35 rows, next day 90 rows.

When I'm on a meeting, I would like to see clearly what Machine we are talking about, so I manually color the rows which are under same machine ID. I would like to make a macro for that, so I dont make a mistake when selecting the rows, and of course to cut the time I am working.

I have thought something of a logic for this, but not sure if this works and of course I don't know the commands needed to use for that or just part, and it als has to be dynamic since number of rows change.

So basically:

bscolor as word
set values to bscolor
If bscolor is 1 then color is white.
If bscolor is 2 then color is green.

macro would start at column A and under the header.
Paint A2 white then set bscolor 1.

go to A3 and check if A3=A2

If yes and bscolor is 1 then paint it bscolor 1 (white).
If yes and bscolor is 2 then paint it bscolor 2 (green).
It they are not the same and bscolor is 1, then paint it with bscolor+1 (green) and bscolor=bscolor+1
It they are not the same and bscolor is 2, then paint it with bscolor-1 (white) and bscolor=bscolor-1

Repeat this until we have the last data in column.

After this copy the color formats to entire row respectively.

Would this work? And what are the commands I have to use for this?

Thank you very much in advance!

3nduranc3