I'm trying to write a VBA script which will delete all rows in my Excel spreadsheet where Column I (which contains a status code) does not contain the word "Completed".
At the moment, I'm doing this the other way round: my script is able to search for entries in Column I which contain the status codes "Pending", "Awaiting Authorisation", "In Progress" etc and delete them. The idea is that when all those rows are deleted, I'll only be left with rows which have a status of "Completed". This works fine at the moment. However, the concern is that if a brand new status code is added to the data file, my script would be unable to pick it up and delete it.
This is a small sample of the code I'm currently using (which deletes all the rows with statuses other than Completed):
How can I re-write this so that it will delete all the rows where the status does not contain "Completed", regardless of whether new status codes are added in the future?
Bookmarks