Recalculate all but one sheet (URGENT)

skutos

New Member
Joined
Aug 4, 2011
Messages
6
Hi,

Is there a way to keep autocalculation on so it recalcs every few minutes but does not recalculate one specific sheet?

I know I can write some VBA code to turn on manual calculation and then loop through the different sheets while leaving out the one I want but then I would have to press the button everytime i want the book to recalculate which is not what I want. I want that my book gets recalculated every few minutes automatically while one of my sheets requires a press of a button in order to let it recalculate.

Any help would be highly appreciated!

ps. My workbook is called "Trade Volume Final_incl PSHYPO TEST" while the worksheets I dont want to update are called "Output Static" and "Output variable"

Thanks!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Something like this...

Adjust Array as needed.

Code:
Sub ButtonPushPauseCalcs()
Dim NoCalc
NoCalc = Array(Sheets("Output Static"), Sheets("Output variable"))
Debug.Print UBound(NoCalc)
For ShtIdx = 1 To Sheets.Count
    For ArrIdx = LBound(NoCalc) To UBound(NoCalc)
        If Sheets(ShtIdx).Name = NoCalc(ArrIdx).Name Then
            Sheets(ShtIdx).EnableCalculation = False
        End If
    Next ArrIdx
    
Next ShtIdx
End Sub

 
 
Sub ButtonPushToCalc()
Dim ForceCalc
ForceCalc = Array(Sheets("Output Static"), Sheets("Output variable"))
Debug.Print UBound(ForceCalc)
For ShtIdx = 1 To Sheets.Count
    For ArrIdx = LBound(ForceCalc) To UBound(ForceCalc)
        If Sheets(ShtIdx).Name = ForceCalc(ArrIdx).Name Then
            Sheets(ShtIdx).EnableCalculation = True
        End If
    Next ArrIdx
Next ShtIdx
Application.CalculateFull
End Sub
 
Upvote 0
Thanks a lot!

So can I just put the first macro into "thisworksheet" so that it doesn't calculate every sheet when I open the worksheet for the first time? The biggest problem is that it takes too long to open up the file when it calculates those two sheets.. Would I have to make some kind of adjustment to do so?
 
Upvote 0
Would be best to put them in their own Module and call them as needed.

Some Options for you... depending on what you ultimately want to happen

Code:
'With a button on sheet Output Variable
Private Sub CommandButton1_Click()
    'Do do the calc and turn it back off
    ButtonPushToCalc
    ButtonPushPauseCalcs
End Sub

Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
    'Would pause the calcs on workbook close
    ButtonPushPauseCalcs
End Sub
 
Private Sub Workbook_Open()
    'Would pause the calcs on workbook open
    ButtonPushPauseCalcs
End Sub

(see part 3 of sig.)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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