Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Sub MyMacro()
- 'dim and consts here
- TurnOffSettings ' turns off settings that slow Excel
- ' rest of code here
- TurnOnSettings ' restores Excel settings
- End Sub
- Sub TurnOffSettings()
- With Application
- .ScreenUpdating = False
- .Calculation = xlCalculationManual
- .EnableEvents = False
- End With
- End Sub
- Sub TurnOnSettings()
- With Application
- .ScreenUpdating = True
- .Calculation = xlCalculationAutomatic
- .EnableEvents = True
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement