Delete rows with specific text
Here is some code that is a little faster since it does not loop through
each
cell...
I tested that on 10,000 rows where every other one said "Total". You're
right, it's a lot faster than the other.
the way I do that is by passing a formula into a routine... (acknowledged,
my method would not work if there were not 1 free column at the far right of
the spreadsheet).
the del_rows subroutine accepts any formula... if it meets the condition, it
evaluates to "", if it doesn't, it evaluates to 1.
the rountine puts the formula in, copies it to the end of the data range,
sorts by the result, and deletes the ones that met the delete condition.
In the same test, that method took about half a second.
|