/ Published in: Visual Basic
Code to turn certain feature off and on for faster running of code in Excel
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Option Explicit Public glb_origCalculationMode As Integer Sub SpeedOn(Optional StatusBarMsgAs String = "Running macro...") glb_origCalculationMode= Application.Calculation With Application .Calculation = xlCalculationManual .ScreenUpdating= False .EnableEvents= False .DisplayAlerts= False .Cursor = xlWait .StatusBar= StatusBarMsg .EnableCancelKey= xlErrorHandler End With End Sub Sub SpeedOff() With Application .Calculation = glb_origCalculationMode .ScreenUpdating= True .EnableEvents= True .DisplayAlerts= True .CalculateBeforeSave= True .Cursor = xlDefault .StatusBar= False .EnableCancelKey= xlInterrupt End With End Sub