Macro turn off screenupdating
If you need to update page numbers, you will have to show the application window before doing the update: With See Page X of Y displays or prints as Page 1 of 1, Page 2 of 2 etc. I hear rumors that you may also need to work with the Range object instead of the Selection object, but I have not tested this nearly enough to give a list because I do almost all of my work with Ranges.By Michael Alexander As your Excel macros become increasingly robust and complex, you may find that they lose performance.The With statement utilized in the following example tells Excel to apply all the formatting changes at one time: Getting into the habit of chunking actions into With statements will not only keep your macros running faster but also make it easier to read your macro code.Macro Recorder is fond of using the Select method to explicitly select objects before taking actions on them.Word does not need to display itself in order to run.
Set the Enable Events property to False before running your macro. If you want to continue to show page breaks after your macro runs, set the Display Page Breaks sheet property back to True. This alternate code uses the Destination argument to bypass the clipboard and copy the contents of cell A1 directly to cell B1.
In worksheets that have a large amount of formulas, this behavior can drastically slow down your macros. Calculation property to tell Excel to switch to manual calculation mode.
When a workbook is in manual calculation mode, the workbook will not recalculate until you explicitly trigger a calculation by pressing the F9 key.
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 to show the current state of the worksheet.
Article contributed by Daryl Lucas Many people know they can speed execution of Word Automation by turning off screen updating: Word. Screen Updating = False Many do not know, however, that they can get an even greater speed boost by hiding the application altogether.