Return to Snippet

Revision: 68989
at April 1, 2015 08:51 by BDOGG32


Initial Code
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

Initial URL

                                

Initial Description
Code to turn certain feature off and on for faster running of code in Excel

Initial Title
SpeedOn and SpeedOff

Initial Tags
excel

Initial Language
Visual Basic