What is the best way to turn on and off screen updating and other applications to reduce interaction with code and screen.
one way AutoDisplay routine below at the start and finish of synatx for code with more that one update
What is the best way to turn on and off screen updating and other applications to reduce interaction with code and screen.
one way AutoDisplay routine below at the start and finish of synatx for code with more that one update
Application.ScreenUpdating doesn't need resetting now I believe
'---------------------------------------------------------------------------------------
' Module : Module1
' DateTime : 12/03/2006 08:42
' Author : Roy Cox (royUK)
' Purpose : Reset Application from one Procedure
' Disclaimer: This code is offered as is and the author
' accepts no responsibility for it's use.
' You may use this code freely, but please leave this header intact.
'---------------------------------------------------------------------------------------
'Get current settings
Dim lCalc As Long
Dim sOldSbar As String
Public Sub AppSetting(Optional arg1 As String = "")
If arg1 = "" Then
lCalc = Application.Calculation
sOldSbar = Application.DisplayStatusBar
sOldAlerts = Application.DisplayAlerts
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
.DisplayAlerts = False
.DisplayStatusBar = True
.StatusBar = "Please wait, busy just now...."
End With
Else
With Application
.Calculation = lCalc
.ScreenUpdating = True
.DisplayAlerts = True
.StatusBar = False
.DisplayStatusBar = sOldSbar
End With
End If
End Sub
Sub Test()
Call AppSetting
MsgBox "Replace with your code "
Call AppSetting("Reset")
End Sub
Display More
Thanks Roy,
straight to the pool room with this synatx
Good to see you around Pike
good to see you fellas are all ok too! - even though they were warning us about it - never would have guest i would see the world pandemic in our life time!
Don’t have an account yet? Register yourself now and be a part of our community!