• Turn off auto calc (Excel 2003)

    Author
    Topic
    #437336

    I have a workbook that contains many formulas. Data entry in this workbook can be very slow because of the auto calc. I turned off the auto calc, but noticed that it it doesn’t come back on automatically with other workbooks that I use. Can anyone tell me if there is some code that would turn off the auto calc when this workbook opens and then turn it back on when the workbook is closed? I would prefer to force a calculation in this workbook as I need it.

    Thanks for your help!

    Viewing 1 reply thread
    Author
    Replies
    • #1039345

      Hi Marie

      have you tried this:

      Private Sub Workbook_Open()
      With Application
      .Calculation = xlManual

      End With

      End Sub

      Private Sub Workbook_BeforeClose(Cancel As Boolean)
      With Application
      .Calculation = xlAutomatic

      End With

      End Sub

    • #1039348

      Or even better:

      Private lngCalc As Long

      Private Sub Workbook_Activate()
      lngCalc = Application.Calculation
      Application.Calculation = xlCalculationManual
      End Sub

      Private Sub Workbook_Deactivate()
      If Not lngCalc = 0 Then
      Application.Calculation = lngCalc
      Else
      Application.Calculation = xlCalculationAutomatic
      End If
      End Sub

      This code goes into the ThisWorkbook module of the workbook.

    Viewing 1 reply thread
    Reply To: Turn off auto calc (Excel 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: