You can try this, it seems to run a bit faster:
With a QuickSort routine:
You will want to edit the set command to point to your real worksheet, and I set up some constants to point to the column numbers that you might want to edit as well: colWPR, colDesc, colTotal.
It essentially does what I was describing earlier: Load the WPR numbers, descriptions and totals into arrays, index sort by WPR number, loop through the sorted WPR's looking for duplicates that haven't been totaled already. For duplicate entries, append to the description and accumulate the totals and set a flag on the record indicating that it has been used as a duplicate. Once all the WPR numbers have been looked at, move the entire description totals array to the spreadsheet. Then loop backwards through the array, building a string of ranges to delete and deleting them. The range object has a limit of 255 characters, so I put a length check and reset in.
On my machine, it took less than two seconds...
Bookmarks