Can I completely disable a worksheet without deleting it?

cjcass

Well-known Member
Joined
Oct 27, 2011
Messages
680
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have an issue that's doing my head in, can anyone help??!!

I've got a large workbook in Excel 2010 that has about 50 worksheets, 100 macros and is about 80MB in size. There are lots of formulas, change events and macros that all run in a strict chronological order to feed lots of metrics and graphics. I press a button which calls the macros in a sequential order and populates the whole workbook at great speed (usually in about 45secs). However it now runs slow (5mins). Through a long process of elimination I have found the problem but not a solution.

There are two worksheets which when deleted from the workbook solve the issue and the macros fly again, however I need to retain the worksheets in the workbook. On scouring the worksheets there appears to be nothing untoward within them - they are not reading 'live' from a source that is being updated by the other macros etc.

Is there a way of completely isolating these two worksheets when the macros are running or by making them temporarily invisible/non-active??

I have tried the following code in each sheet but it has no effect:
Code:
Option Explicit
  
Private Sub Worksheet_Activate()
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    Application.EnableEvents = True
    
End Sub
 
Private Sub Worksheet_Deactivate()
    Application.Calculation = xlCalculationManual
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    Application.EnableEvents = False
    
End Sub
Any help massively appreciated!!
Thanks,
 
Last edited by a moderator:
Ok many thanks for your help I'll continue to try and work out why they are an issue.
Rgds,
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
You might try deleting all the data and see if it's still slow. If it is, you can then post a copy on a site like OneDrive or Dropbox and pust a link here so that people can take a look at it without any confidential data.
 
Upvote 0

Forum statistics

Threads
1,215,780
Messages
6,126,857
Members
449,345
Latest member
CharlieDP

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