Disable automatic calculations on 1 sheet only

brianfosterblack

Board Regular
Joined
Nov 1, 2011
Messages
185
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?
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Dossfm0q

Banned User
Joined
Mar 9, 2009
Messages
570
Office Version
  1. 2019
Platform
  1. Windows
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
 

brianfosterblack

Board Regular
Joined
Nov 1, 2011
Messages
185
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,331
Messages
5,624,061
Members
416,008
Latest member
PETE91

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
Top