Every day I get a large worksheet with thousands of rows (each day it's a different number of rows), only 50-60 of which I'm actually concerned about. I've been using interactive filtering to limit my view to just the relevant rows, but the row numbers don't change, so that suggests to me that all the irrelevant rows are still in the spreadsheet, they're just hidden. I'd very much like to actually delete the irrelevant rows, since I need to send the relevant subset to other people via email and the resulting attachments are currently huge, and I'd like to do it in a macro, since it's a task I do daily. But I'm an absolute novice at VBA and need help with the code.
I want to delete any row that matches either of these two criteria:
EITHER
1. Column A is blank.
OR
2. The text in Column B does NOT include any of the five product codes I'm concerned with. Column B contains both the product code and the long text name of the product, so I'd rather not have to test on the full text of the contents of Column B; I'd just like to check to see if any of my product codes is in there. I *could* test on the full contents if I need to; I'd just rather not. If Column B contains one of my product codes, I need to keep the row and not delete it.
In another thread from 2011 I found some code to test for partial values in an array, but I couldn't figure out how to add my second criterion and delete the entire row if either criterion was met.
Thanks very much, in advance, for any help.
I want to delete any row that matches either of these two criteria:
EITHER
1. Column A is blank.
OR
2. The text in Column B does NOT include any of the five product codes I'm concerned with. Column B contains both the product code and the long text name of the product, so I'd rather not have to test on the full text of the contents of Column B; I'd just like to check to see if any of my product codes is in there. I *could* test on the full contents if I need to; I'd just rather not. If Column B contains one of my product codes, I need to keep the row and not delete it.
In another thread from 2011 I found some code to test for partial values in an array, but I couldn't figure out how to add my second criterion and delete the entire row if either criterion was met.
Thanks very much, in advance, for any help.