Mature hook up - Screen updating off

by  |  03-Feb-2020 10:15

Let me know if you think that you have a better solution! NET) Class to handle the changing of settings and storing of original state: Public Class Application Settings Implements IDisposable Private Screen Updating As Boolean Private Events As Boolean Private Production As Boolean = True Public Sub New() My Base.

I always assumed it was just used so that it didn't scare end users into thinking their PC was about to crash.

One thing you may want to do with your macro to make it run faster and to prevent distracting flashes on the screen is to turn off screen updating while the macro is running.

screen updating off-18screen updating off-3

When I started reading more into improving the efficiency of your code I understood what it was for but how much of an effect does Turning off screen updating will only make a difference to execution time if the code interacts with Excel in a way that causes changes to the screen content.

The grater the amount of screen changes the bigger the impact will be. Other application settings that can make a difference to execution time are Calculation and Event handling. Enable Events = False ' Code here Clean Up: On Error Resume Next Application. Calculation = xl Calculation Automatic Application. Enable Events = True Exit Sub EH: ' Do error handling Go To Clean Up End Sub Sub test Screen Updating() Dim i As Integer Dim numb Switches As Integer Dim results As String 'swap between sheets this number of times numb Switches = 1000 'keep track of time Dim start Time As Double start Time = Time 'swap between sheets 1/2 (need both sheets or this will crash) For i = 1 To numb Switches Sheets(1 (i Mod 2)).

And after all don’t turn screen updating on/off many times in some loop. And one more note (which you probably don’t want to hear) if you want it quick use C .

Many people write their own macros to manipulate the information in a workbook.

Many times the macro may do quite a bit with the data, such as selecting different cells, replacing values or formulas, and taking other types of actions.

Community Discussion