Calculation manual / automatic
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Calculation manual / automatic
Is there a way of setting calculation to manual when a specific worksheet is activated, and then set to automatic upon deactivation. But preferably only applicable to manual activation / deactivation, not when vba does it?
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 78630
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Calculation manual / automatic
You could use this code in the worksheet module:
If you want to switch to the worksheet in code, turn off event handling temporarily:
Code: Select all
Private Sub Worksheet_Activate()
Application.Calculation = xlCalculationManual
End Sub
Private Sub Worksheet_Deactivate()
Application.Calculation = xlCalculationAutomatic
End Sub
Code: Select all
Application.EnableEvents = False
Worksheets("MySheet").Select
Application.EnableEvents = True
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.