I'm working on automating removing some rows of data from multiple files. One of the criteria is to exclude all products except a specific list. Currently I'm doing that by iterating through the rows and deleting rows that aren't for the right product.
I'm thinking that sorting the rows so that the products to be kept are first, and the ones to be deleted are clumped together lower down in the data would be faster, as I could then just find the first bad row and clear contents (as opposed to Range("<XX:XX>").Delete Shift:=xlUp
).
The trouble I'm having is that the products actually present in any of the files varies, as does the list of products to be kept. It's pretty much a unique list of products to keep for each of over a dozen files.
So what I'm hoping is that there is a way when I specify the custom sort list such that I can have a single item for all other products I didn't explicitly list.
For example, if I wanted sort the alphabet "V, C, R, ", would there be a way to do so without specifically listing every other letter in the alphabet?
I'm avoiding specifying the remainder of the list for two reasons. One, the list is fairly long and retyping the full list for each of the files I need to sort would be pretty error prone and hard to maintain. Two, the product list is not necessarily static going forward, so I don't want to have to update the macro each time a new product is added.