Whenever you have this many rows try and avoid loops like the plague. In fact try and avoid loops full stop if possible. They are always without exception very slow, particularly when each iteration through the loop has to jump backwards and forward between VBA and the Excel App.
Always try and use bog standard Excel functionality since this will always be more efficient. Even if you need to encode it in a macro. In cases like this the fastest way I know is to use a Data Filter to highlight the data and then do with the filtered data whatever you want. If you have many formulae and filtering is slow then first switch to manual calc., switrching back to automatic at the end.
Try the following which is the equivalent of your looping macro
Bookmarks