Turn Stuff Off/On
Two helper macros that speed up every other macro on this site. Turn Stuff Off pauses events, screen updating, alerts and automatic calculation while a macro runs. Turn Stuff On switches them all back.
- Install these two first: most of the other macros call them.
- Excel won't behave normally while things are switched off, so every macro ends by calling Turn Stuff On.
VBA: Turn Stuff Off
Sub TurnStuffOff()
Application.EnableEvents = False
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
End Sub VBA: Turn Stuff On
Sub TurnStuffOn()
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.Calculation = xlCalculationAutomatic
End Sub New to macros? Set up your Personal Macro Workbook first, then paste this code into its module.