Have you ever wondered why it takes so long for your workbook to execute the vba code. That’s because of the default settings in Excel. Here’s how you can speed it up.
Sub main()
ApplicationSettings False
‘do some processing for example loading and manipulating workbook
ApplicationSettings True
End Sub
Sub ApplicationSettings(Enabled As Boolean)
‘Status Bar
Application.DisplayStatusBar = Enabled
‘Message boxes from appearing
Application.DisplayAlerts = Enabled
‘Event driven procedures
Application.EnableEvents = Enabled
‘Calculations
If Enabled = False Then
Application.Calculation = xlCalculationManual
Else
Application.Calculation = xlCalculationAutomatic
End If
‘PageBreaks
ActiveSheet.DisplayPageBreaks = Enabled
‘Seeing Excel Changes
Application.ScreenUpdating = Enabled
End Sub
Filed under: Application
Trackback Uri

