Disable automatic calculations on 1 sheet only

brianfosterblack

Active Member
Joined
Nov 1, 2011
Messages
251
I have a multi sheet workbook but a lot of formulas on 1 sheet which is slowing down the workbook significantly because of the calculations being automatic and the numbers involved. I do not want to disable automatic calculation for the whole workbook but only for the one sheet named "Control"
When open this worksheet, only then do I want to activate the automatic calculations on this sheet and when I leave the worksheet I want to deactiveate the automatic calculations for that sheet only. Is there a way to do this with VBA in the worksheet code?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Into WorkBook Module
VBA Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)

If Sh.Name = ThisWorkbook.Worksheets("Control").Name Then
'If Sh.Name = "Control" Then
    Application.Calculation = xlManual
    'Application.Calculation = xlAutomatic

Else
    Application.Calculation = xlAutomatic
    'Application.Calculation = xlManual
End If

End Sub

Picture2.gif
 
Upvote 0
Into WorkBook Module
VBA Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)

If Sh.Name = ThisWorkbook.Worksheets("Control").Name Then
'If Sh.Name = "Control" Then
    Application.Calculation = xlManual
    'Application.Calculation = xlAutomatic

Else
    Application.Calculation = xlAutomatic
    'Application.Calculation = xlManual
End If

End Sub

View attachment 32440
Thank you, This works perfectly.
 
Upvote 0

Forum statistics

Threads
1,214,962
Messages
6,122,482
Members
449,088
Latest member
Melvetica

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top