Recently I found a way to significantly speed up a macro that I was running. I will use the macro from last weeks blog post to demonstrate how this can be done.
Last week I demonstrated how to transfer data from multiple forms into rows of a master document using a macro. Refresher, This macro takes values from multiple forms and inputs those values within rows of a master file. The macro opens each file and then an alert page shows up asking if changes should be saved or not. Placing the following code within the macro will prohibit any alerts from being displayed while the macro is running thus speeding up the macro.
Application.DisplayAlerts = False
In addition to the code above, the following code will also prohibit showing screen updates (in the input files) while the macro is being executed and therefore speeding up the macro even more.
Application.ScreenUpdating = False
Here is the full updated code for the macro. By applying the aforementioned codes within the macro I managed to cut the execution time of this macro in half.