ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Stop and start Sheet recalculation (https://www.excelbanter.com/excel-discussion-misc-queries/174817-stop-start-sheet-recalculation.html)

jlclyde

Stop and start Sheet recalculation
 
Hello all,
I am trying to set that when a worksheet changes at D3, I would like
to open up another workbook that the original workbook calculates
from. Since the opening workbook has thousands of formulas it is set
to Calculation Manual. I need to open this workbook and then
calculate each of the sheets in the original. This code works but it
takes almost 3 minutes to run and I can do it all manualy in 30
seconds. Can anyone help. here is my code below.
Jay

Private Sub Worksheet_Change(ByVal Target As Range)
Const strWbkPath2 As String = "G:\Workload_Info\Output--
Efficiencies\Combined DPE's.xls"

If IsFileOpen(strWbkPath2) = True Then
MsgBox "File already open by another user. Try again
later!"
Else
If Target.Column = 4 And Target.Row = 3 Then
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Workbooks.Open filename:="G:\Workload_Info\Output--Efficiencies
\Combined DPE's.xls"
Sheet1.Calculate
Sheet2.Calculate
Sheet3.Calculate
Sheet4.Calculate
Sheet5.Calculate
Sheet6.Calculate
Sheet7.Calculate
Sheet8.Calculate
Sheet9.Calculate
Sheet10.Calculate
Sheet11.Calculate
Sheet12.Calculate
Sheet13.Calculate
Sheet14.Calculate
Sheet15.Calculate
Sheet16.Calculate
Workbooks("Combined DPE's.xls").Close SaveChanges:=False
Workbooks("New DPE.xls").Save
End If
End If
End Sub


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com