If you work with VBA macros, you probably have a few lines of code, which you write before you start the actual coding. In this area we include turning off calculations, displaying alerts and screen updating. With other words, this is what I use at the beginning of my macros:
1 2 3 |
Application.Calculation = xlCalculationManual Application.DisplayAlerts = False Application.ScreenUpdating = False |
At the end I return the screen updating and the display alerts. I do not return the calculation method, as far as I prefer manual calculation. I turn the status bar to false, due to the fact that sometimes I display there lots of stuff and it is not nice, when it could be found there later.
1 2 3 |
Application.DisplayAlerts = True Application.ScreenUpdating = True Application.StatusBar = False |
At the end, if you work with MS Access the following is really important:
1 2 |
DoCmd.SetWarnings True DoCmd.SetWarnings False |