Notification when Recalculation is Done

Written by Allen Wyatt (last updated April 9, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


2

Jim has a large worksheet with many data tables that can take several minutes to recalculate. He wonders if there is a way to set an audible alert to notify him when the recalculation is completed.

This can only be done using a macro. You could, if desired, use a macro to do the actual calculation, in this manner:

Sub MyCalc()
    Application.Calculate
    Beep
End Sub

Whenever the macro is called, all open workbooks are calculated and, when complete, a "beep" is heard on the computer speaker. The volume, duration, and quality of the beep will vary wildly from system to system, so you may want to display a message box right after the beep:

Sub MyCalc()
    Application.Calculate
    Beep
    MsgBox "Calculation completed"
End Sub

Another benefit of adding the message box is that if the recalculation is completed while you are away from your system, then you'll have the visual cue when you return.

A better solution, however, might be to set up an event handler that will be triggered whenever a calculation is complete. Right-click on a worksheet tab, choose View Code, and add the following to the resulting code window:

Private Sub Worksheet_Calculate()
    Beep
    MsgBox "Calculation completed"
End Sub

Note that there is no express command to calculate the worksheet. That is because the event is automatically triggered after calculation of the worksheet is completed. Since this is a worksheet-level event, it is only triggered for the single worksheet. If you would like to have the same process occur whenever any worksheet in the workbook is completed, you could, instead, add the following to the ThisWorkbook module:

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
    Beep
    MsgBox "Calculation completed"
End Sub

Finally, there is another enhancement that you could add to whichever approach you choose. Anyplace you see the Beep command in the above code, you could replace the line with the following:

    Application.Speech.Speak "Recalculation completed"

This uses the speech capability of Excel to tell you that the recalculation is completed.

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 (12857) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

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

Turning on Placeholders

A large number of graphics in a worksheet can slow down Excel. One way to compensate is to turn on picture placeholders, ...

Discover More

Extra Spaces after Inserting a Building Block

Building blocks are a great tool for inserting standard information in your documents. It is also possible, however, to ...

Discover More

Using Fields for Fractions

Want a quick way to create fractions? You can do it by using fields, as described in this tip.

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Copying Data between Worksheets Using a Macro

Macros can be used for all sorts of data processing needs. One need that is fairly common is the need to copy data from ...

Discover More

Selectively Importing Records

Want to easily control which records get imported from a text file into Excel? It's easy to do when you write the macro ...

Discover More

Displaying Worksheets in a Slideshow Fashion

Want to step through the worksheets in a workbook, displaying them like a slideshow? The macros provided in this tip can ...

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 less than 9?

2022-04-12 17:58:34

J. Woolley

Re. the Tip's suggested use of Application.Speech, My Excel Toolbox includes the following text-to-speech function:
=Speak(This)
where This is a range or value (text, numeric, logical, or error). For example:
=Speak(A1:C3)
=Speak(D4)
=Speak(1234567.89)
=Speak(TEXT(1234567.89,"$#.00"))
=Speak(TEXT(NOW(),"hh:mm am/pm"))
=Speak("ToggleSpeak") -- toggle it ON/OFF
Here is an abbreviated version:

Function Speak(This)
    If TypeName(This) = "Range" Then
        For Each cell In This
            Application.Speech.Speak CStr(cell.Value), True
        Next cell
    Else
        Application.Speech.Speak CStr(This), True
    End If
End Function

Also, the ToggleSpeakOnEnter macro toggles Application.Speech.SpeakCellOnEnter, which speaks any cell's value when the Enter key is pressed.
See https://sites.google.com/view/MyExcelToolbox/


2022-04-09 13:02:41

Jacques

Very good tip indeed!

However, may be it is a misperception of mine, that does not seem to work with the new function "StockHistory".

I am using this functions to get the history of more than 100 stocks, each stock on its own sheet. When I open the workbook, today date is replaced in each function call but does not seem to trigger the recalculation of all sheets.


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.