Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Calculating Only the Active Workbook.

Calculating Only the Active Workbook

Written by Allen Wyatt (last updated August 31, 2019)
This tip applies to Excel 97, 2000, 2002, and 2003


2

Linda asked if there is a way to calculate only the active workbook. When a recalc is performed by Excel, it recalculates all her open workbooks, and if they are very large workbooks it can sometimes take over fifteen minutes to recalc. If she is able to limit what is recalculated, then the process will obviously run faster.

Unfortunately, there is no direct method to just calculate a particular workbook. You can, however, calculate just the active worksheet, if desired. First, set the recalculation mode to manual by following these steps:

  1. Choose Options from the Tools menu. Excel displays the Options dialog box.
  2. Make sure the Calculation tab is displayed. (See Figure 1.)
  3. Figure 1. The Calculation tab of the Options dialog box.

  4. Select the Manual check box.
  5. Click OK.

Now the only time your workbook (actually, all your open workbooks) will be recalculated is when you press F9. If you want to recalculate only the current worksheet, then press Shift+F9.

Excel also provides macro functions that allow you to do any of these three things: calculate all open workbooks, calculate a specific worksheet in a workbook, or calculate a specified range of cells on a worksheet. With this knowledge you could create a macro that would loop through all the worksheets in a workbook and recalculate each of them.

The following macro sets the calculation mode to manual (so the other workbooks will not calculate) and then loops through and calculates each sheet of the active workbook.

Sub CalcBook()
    Dim wks As Worksheet
    Application.Calculation = xlManual
    For Each wks In ActiveWorkbook.Worksheets
        wks.Calculate
    Next
    Set wks = Nothing
End Sub

If you believe that you may want to calculate different parts of your workbook at different times, you can expand the macro so that it will perform any type of calculation you may want:

Sub CalcWhat()
    Dim iAnsure As Integer

    Application.Calculation = xlManual
    iAnsure = InputBox("1 = Calculate A Used Range" _
      & vbCrLf & _
      "2 = Calculate This Worksheet" _
      & vbCrLf & _
      "3 = Calculate This Workbook" _
      & vbCrLf & _
      "4 = Calculate All Workbooks in Memory" _
      & vbCrLf & vbCrLf & _
      "Input Your Selection Number From Above" _
      & vbCrLf & "Then Click OK", _
      "Calculate What?", "Input Number Please", _
      5000, 5000)

    Select Case iAnsure
        Case 1 'Range Only
            Selection.Calculate
        Case 2 'Worksheet Only
            ActiveSheet.Calculate
        Case 3 'Workbook Only
            For Each wks In ActiveWorkbook.Worksheets
                wks.Calculate
            Next
        Case 4 'All Open Workbooks
            Application.CalculateFull
        End
    End Select
End Sub

This macro presents an input box that prompts the user as to which type of recalculation is desired. When the user enters a number from 1 to 4, the desired type of recalculation is performed.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2877) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Calculating Only the Active Workbook.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Quickly Inserting Table Rows

Need to pop a few extra rows into a table? It is easy to do using the same tools you used to create the table in the ...

Discover More

Deleting All Footnotes

Tired of all those footnotes hanging on the bottom of each page in your document? You can get rid of them in one step, as ...

Discover More

Proper Comparisons for Dates in Merge Fields

How Word merges a data source with a document is controlled by merge fields. In those fields you may want to compare ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Problems with Default Workbook and Worksheet Templates

You can create a default template for both your workbooks and worksheets. These should be placed in the xlstart folder, ...

Discover More

Automatically Hiding the Personal Workbook

If you leave your Personal.xls workbook visible from one Excel session to another, you may find that you unwittingly make ...

Discover More

Unwanted Read-Only Workbook Status

Once a workbook assumes a "read-only" status, it can be a real pain to get that status removed. This tip explains why and ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

2021-07-09 17:12:17

Allen

Andrew,

This article is for very old versions of Excel because there are people still using them. However, there is a link at both the beginning and end of the article that will take you to a version for newer versions of Excel.

-Allen


2021-07-09 11:42:18

Andrew Tebbutt

Please could you update this so it refers to the modern Excel layout? Excel hasn't had an options menu for around 10-15 years. How do I follow these steps on Excel 2016?


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.