This saves time and resources, allowing your macro to run a little faster.Once you macro code is done running, you can turn screen updating back on.While I’m thinking about this stuff, I’d like to share a few simple tips for speeding up your Excel VBA code. So feel free to comment and share any other performance tips you may have.

You can improve the performance of your macro by suspending the recalculation of the pivot table until all your pivot field changes have been made. Manual Update property to True to defer recalculation, run your macro code, and then set the Pivot Table. Manual Update=True It’s important to remember that while the Macro Recorder saves time by writing VBA code for you, it doesn’t always write the most efficient code. If you were to record a macro applying these formatting options to cell A1, you would get something like this.

Manual Update property back to False to trigger the recalculation. A prime example of this is how the Macro Recorder captures any copy and paste action you perform while recording. Value If you need to copy only the formulas from one cell to another, (not values or formatting), you can set the formula of the destination cell to the same formula contains in the source cell. Unfortunately, this code is not as efficient as it could be because it forces Excel to select and then change each property separately. Underline = xl Underline Style Single End With The Macro Recorder is quite fond of using the Select method to explicitly select objects before taking actions on them.

Set the Display Page Breaks sheet property to False in order to hide page breaks.

If you want to continue to show page breaks after your macro runs, you can set the Display Page Breaks sheet property back to True.

Setting the calculation mode back to xl Calculation Automatic will automatically trigger a recalculation of the worksheet. Calculation = xl Calculation Manual You may notice that when your macros run, your screen does a fair amount of flickering.

This flickering is Excel trying to redraw the screen in order to show the current state the worksheet is in.

The status bar normally displays the progress of certain actions in Excel.

For example, if you copy/paste a range, Excel will show the progress of that operation on the status bar.

Once you macro code is done running, you can set the Enable Events property back to True.