I have a worksheet that looks like this example worksheet I have made:
For sheet1 I need some code that can insert a new row below the last row in each group, then copy the last row in each group and insert it below the last row in each group the number of times defined in the datasheets Number of customers in group cells. I have only 3 groups in this example sheet, but I would maybe need to expand to 6 groups later on. If I later on change the value of those number of customers in group cells to a lower number, the rows that are too much in sheet1 should be deleted, starting with the last row in each group. Its also important that data isnt erased unless its located in the last row of each group and that row is being deleted by the code because a lower number was specified in the datasheets Number of customers in group cells. It is also important that the rows being copied and inserted isnt deleting any rows from the next group, but that I think wouldnt happen if a new row first was inserted and then the last row was copied to that row.
The rows in sheet1 represents 1 customer and only 1.
Thanks in advance for your time