Attribute VB_Name = "modSpeed" '|ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ| '| Excel state management routines Simon Murphy Codematic.net | '| | '| Be sure to include unspeed in your error handler | '| So things get switched back on if your code errors | '| | '| Version dated 20090909 | '|________________________________________________________________________________________| Option Explicit Option Private Module Private mlCalcStatus As Long Private mbInSpeed As Boolean Public Sub speed() On Error Resume Next If Not mbInSpeed Then Application.ScreenUpdating = False Application.DisplayAlerts = False Application.EnableEvents = False mlCalcStatus = Application.Calculation Application.Calculation = xlCalculationManual mbInSpeed = True Else 'we are already in speed - don't do the settings again End If End Sub Public Sub unspeed() On Error Resume Next Application.ScreenUpdating = True Application.DisplayAlerts = True Application.EnableEvents = True If mbInSpeed Then Application.Calculation = mlCalcStatus Else 'this shouldn't be happening - put calc to auto - safest mode Application.Calculation = xlCalculationAutomatic End If mbInSpeed = False End Sub