I have an Excel sheet that I need to delete rows out of. It will have about 5,000 rows of data that I have inserted subtotals into. Basically, on one file (I will call it data file) I will have a part number and units, so say part XYZ has a quantity of 5. On my second worksheet (which I will call claim file), XYZ will add up to quantity of 89 with extra data (like where it was sold) but I need to delete off the extra rows so that my claim file will only add up to the quantity allowed on data file.

Just to give an idea of what I was doing, was inserting subtotals into claim file, and then manually looking up how many I was allowed out of data file and deleting the extra rows. There are about 50 part numbers in total so this is taking some time.

I think there is probably a more automated way to have these deletions happen, does anyone have any ideas?