If you reverse the order of the deletions (typically, change a for i = 1 to n loop to a for i = n to 1 step -1), each compaction works with fewer rows. Of course, that may also affect any other workbooks already open on your desktop.
It is also much easier to keep track of your place, because you don't have to adjust the "current" row number to account for the deleted row. If you do that, be sure that not only is the visible setting at the end of your sub but that it also is used as part of some error handling routine.
Well, when you run VBA code in Excel, you will notice that the screen flickerseach time an action is performed.
I am running a macro that is moving down through the lines of a spreadsheet and deleting some of the lines depending on content. The speed of the operation is slowed because the screen updates with every movement.
EXE process.) How much of a difference does invisibility make?
This page lists some suggestions and strategies for optimizing your Visual Basic For Applications (VBA) code, so that it will run faster.
Turned it back off for that connection and the workbook no longer flashes.
Display Alerts = True End Sub option back on for one of the connections and the flashing started again.