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

Calculating Only the Active Workbook

Written by Allen Wyatt (last updated May 20, 2023)
This tip applies to Excel 2007, 2010, 2013, and 2016


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. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 and later versions display the File tab of the ribbon and then click Options.)
  2. Click the Formulas area at the left of the dialog box. (See Figure 1.)
  3. Figure 1. The Formulas options of the Excel Options dialog box.

  4. In the Calculation Options section of the dialog box, make sure the Manual radio button is selected.
  5. Click on 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 (6752) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel 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

Adding Pop-Up Documentation to a Cell

Want to have a small help screen pop up when a user selects a particular cell? This can be done by using data validation, ...

Discover More

Sizing Columns and Rows Using the Keyboard

Are you a keyboard-only user wondering how you can set column width or row height without using the mouse? This tip ...

Discover More

Searching for Text Not Using a Certain Style

Word is very flexible in what it allows you to search for. One thing it can't do, however, is allow you to search for ...

Discover More

Best-Selling VBA Tutorial for Beginners Take your Excel knowledge to the next level. With a little background in VBA programming, you can go well beyond basic spreadsheets and functions. Use macros to reduce errors, save time, and integrate with other Microsoft applications. Fully updated for the latest version of Office 365. Check out Microsoft 365 Excel VBA Programming For Dummies today!

More ExcelTips (ribbon)

Renaming a Macro

Got a macro that doesn't have quite the right name? You can rename the macro by following these simple steps.

Discover More

Excel Crashes when Running Macros

It can be frustrating when macros don't run as you expect. When it occurs, however, tracking down the cause can be even ...

Discover More

Recording a Macro

One of the most common ways of creating macros is to use Excel's macro recorder. This tip shows how easy it is to use the ...

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 seven more than 2?

2024-03-22 12:59:37

J. Woolley

Here are Microsoft's descriptions of the calculation keyboard shortcuts, but I find them difficult to understand or confirm:

F9 – Recalculate formulas that have changed since the last calculation, and formulas dependent on them, in all open workbooks. If a workbook is set for automatic recalculation, you do not need to press F9 for recalculation.

Shift+F9 – Recalculate formulas that have changed since the last calculation, and formulas dependent on them, in the active worksheet.

Ctrl+Alt+F9 – Recalculate all formulas in all open workbooks, regardless of whether they have changed since the last recalculation.

Ctrl+Alt+Shift+F9 – Check dependent formulas, and then recalculate all formulas in all open workbooks, regardless of whether they have changed since the last recalculation.


2024-03-21 10:02:20

James Buist

The question I have here is this. If I calculate a single sheet, say sheet 1 which has references from sheet 2, will it calculate what it needs in sheet 2 before calculating sheet 1 or will it just take the current calculated values in sheet 2 and use them in the sheet 1 calculation. If the former, then your concept of looping through the sheets would work. But if not, then using this method could easily give you false results unless you recalculate the sheets in the reverse order of dependencies.

I really do not understand why MS have not got an option to recalculate a single workbook as the calculation engine does all the dependency checking and recalculates as required


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.