I have a macro that works on a large table of data (like 350K rows). In order to delete all rows that don't meet certain criteria, I write a "flag" formula (that results in 1 or 0) into an empty column, then sort on that flag column, and delete the entire block of rows where the flag = 0.

My problem is that the sort operation takes MUCH longer when the macro does it, than when I do the same sort manually, on the same data. It takes maybe 10 seconds or so when I sort it manually, but when the macro runs the sort (stepping through it, or letting it run), it takes minutes, and much of that time I see "(Not Responding)" in the title bar.

Any ideas on what's happening or how to fix it? I'm running Excel 2007 on a Windows 8 computer.