Thank you both. I can use either of those macros, they both work perfectly.

I would like to make one slight modification. Can the macro also copy rows that have "#N/A" in column AE in addition to "1"?