Hello everyone,

I have a pretty large amount of data with whom I am working with. My sheet has around 2800 rows and 6 used columns. This sheet will need to be replicated around 70 times.. which makes a lot of work. That is why i am looking to have it as automatic as possible.

The sheet looks pretty much like this (but it is much longer than this):

Macocategory New Category Old Category Deck number Combination Code Count
AAA XXX 1 5 01010105 10
AAA XXX 1 7 01010107 8
AAA ZZZ 1 5 01020105 20
BBB XXX 2 5 02020205 10


Basically, the info contained in column 3,4 and 5 (Old category, deck number and combination code) is not relevant for what I am willing to do.

What I am looking for is a Macro which would insert a line where the entry in column 1 or 2 is different from the entry in the same column of the previous line.

e.g.: columns 1 and 2 in row 1 and 2 in the above example are identical. so i'd only like to have one row inserted on the top of the list because it is the first row. Between row 2 and 3 there is a difference in column 2 (xxx and zzz). I'd like the macro to insert a row between those two rows.
Again, between row 3 and 4 there is a difference in column 1(aaa and bbb). I'd like the macro to insert a row between row 3 and 4.

Moreover, I need column 1 and 2 of the inserted row to be filled with exactly the same information contained in the rows directly under it. Last but not least, column 6 of the new row will show the sum of the entries contained in the previously existent rows between the 2 new rows.

Below an example of what i mean/need:

Macocategory New Category Old Category Deck number Combination Code Count
AAA XXX blank blank blank 18
AAA XXX 1 5 01010105 10
AAA XXX 1 7 01010107 8
AAA ZZZ blank blank blank 20
AAA ZZZ 1 5 01020105 20
BBB XXX blank blank blank 10
BBB XXX 2 5 02020205 10


Hope it is a little more comprehensible now! Guys, please, I am completely ignorant about macros so please be very patient with me.

I'd like to thank you in advance for any help you'd be able to give me.

cheers!