Changing Boolean settings
Sub togglepagebreaks()
On Error Resume Next
ActiveSheet.DisplayPageBreaks = Not ActiveSheet.DisplayPageBreaks
End Sub
Changing non-Boolean settings
Sub calcmanual()
Application.Calculation = xlCalculationAutomatic
End Sub
Sub calcmanual()
Application.Calculation = xlCalculationManual
End Sub
Sub togglecalcmode()
Select Case Application.Calculation
Case xlManual
Application.Calculation = xlCalculationAutomatic
MsgBox "automatic calculation mode"
Case xlAutomatic
Application.Calculation = xlCalculationManual
MsgBox "manual calculation mode"
End Select
End Sub
No comments:
Post a Comment