Neat code for pasting filtered data to a separate worksheet
One of the sheets in my excel model contains a long list of data. I
need some code to copy the data into another sheet, but exclude the
rows where one of the columns contains the words “Don’t Work”. I can
think of 2 ways of doing this:
a) Writing a macro that applies a filter to the source worksheet then
copies and pastes the data into the destination sheet (a bit messy);
or
b) Writing a macro that cycles through the source rows one by one,
adding the row to a union range if it doesn’t contain “Don’t work”,
then dropping the data from in this range into the destination sheet
(I have used a similar approach to this before and found it very slow
with 20k+ rows).
The query is whether there is a smarter and quicker way of doing this
available?
I know this would be straightforward in Access, but my brief is to
prepare this model in excel.
Thanks
John
|