Prevent excel from updating inactive worksheets ?

Morphil

New Member
Joined
Jan 8, 2007
Messages
11
hello,
I have built an Excel file which can be considered as :

2 data base on 2 separate sheets :
1rst (item descriptor) defining the known characteristics of items
2nd (stock) saying how many of such items are in stock

1 input formular on 1 other sheet

2 output formulars on 2 other sheets

The I/O formulars allow to define new items, add/remove items in stock ... IN OTHER WORDS, they are linked to the 2 data bases through many SUMPRODUCT functions. The formulars run also VBA macros to check coherency before inputting/outputting/creating ... items

All this works fine BUT SLOWLY !
What I noticed is the following : if I simply REMOVE the 2 Output formulars sheets (when using the input one) execution is Much quicker. WELL, if I am a SINGLE user, and want ONLY to use one of the formulars at a time, I don't care that Excel spends time upgating cells on NON ACTIVE sheets ! Of course when switching from Input to Output formular (in other words changing the active sheet) I fully understand/accept some extra processin (updating) time

SO, to summarize, IS THERE A WAY TO PREVENT EXCEL FROM UPDATING INACTIVE WORKSHEETS ?

br
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
you could have a workbook open event to turn sheet2 to manual calculation,
also
sheet1 "worksheet activate" to turn sheet2 to manual calculation
sheet2 "worksheet activate" to turn sheet2 to automatic calculation
 
Upvote 0
maybe something like this

Code:
Private Sub Worksheet_Activate()

' Automatic calculation for this sheet is turned off by default
' when the page tab is clicked, the calculation is turned ON
' and calculates the page (for updates) and then turns the calculation to Manual
' This is so the spreadsheet works faster and repeated re-calculations do not
' slow down the overall performance of the spreadsheet

With ActiveSheet
    .EnableCalculation = True
    .UsedRange.Calculate
    .EnableCalculation = False
End With
End Sub
 
Upvote 0
almost forgot
in the "ThisWorkbook" module put this

Code:
Private Sub Workbook_Open() 'sheet2 will be manual cal when wkbook opens

' This turns off the Automatic calculation for the sheets listed below.
' Each sheet's calculation is turned ON temporarily when the 
' sheet tab is clicked by the worksheet activate event

Sheet2.EnableCalculation = False 

End Sub
 
Upvote 0
If all the cells in a sheet are inactive, copy/paste special values will replace the formulas on that page, leaving the data. Which will make the formulas on the other sheets calculate faster.
 
Upvote 0
Hi Paul,
It's really A M A Z I N G !!!
it did benchmark before and after your suggestion :
before : 6 I/O per minute only
after : 150 I/O per minute
I can hardly believe it

Thanks, Thanks Thanks a lot
Best regards
 
Upvote 0
Such is the beauty of a public access forum.
I got most my code from this site in the first palce. :)
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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