Code Snippet "VBA Excel"
Calculation State umstellen
'************************************************************************
'toggles the calculation state to manual and back
'Author: Silvia Rothen
Sub changeCalcToManual(ByVal blnTrue As Boolean)
Static calcType
Static calcBeforeSave
If blnTrue Then
'save old state
calcType = Application.Calculation
calcBeforeSave = Application.CalculateBeforeSave
'change to manual
Application.Calculation = xlManual
Application.CalculateBeforeSave = False
Else
Application.Calculation = calcType
Application.CalculateBeforeSave = calcBeforeSave
End If
End Sub