How to Make a Recalculate Button in Excel (5 Easy Steps)

The Recalculate button allows you to update formulas in your dataset. If you’re using volatile functions that change over time, you’ll need to recalculate the formulas. Fortunately, you can achieve this with a simple button using VBA macros. Let’s dive into the easy steps for creating a Recalculate button in Excel:

Dataset


Step 1 – Create a VBA Module

  • Go to the Developer tab and select Visual Basic.

Create a VBA Module for excel recalculate button

  • Click on the Insert tab, choose Module, and create a new module (e.g., Module1).

  • Enter the following VBA code in the module:
Sub RecalculateActivesheet()
  ActiveSheet.Calculate
End Sub

VBA code for excel recalculate button

Read More: How to Recalculate in Excel


Step 2 – Insert the Recalculate Button

  • Hover over the Developer tab and navigate to the Insert command in the Controls section.
  • Choose a Button from the Form Controls options.

Insert the Recalculate Button in Excel

  • An Assign Macro dialog will appear; click OK.

  • A new button (Button 1) will be created. Right-click on it and select Edit Text to rename it (e.g., Recalculate).

Edit text for excel recalculate button


Step 3 – Modify the Button’s Appearance

  • Right-click on the button and choose Format Control from the Context Menu.

Modify the Button of recalculate

  • In the Format Control window, select Bold for the font style, set the Size to 14, and choose your preferred Color. Click OK.


Step 4 – Assign the Macro to the Recalculate Button

  • Right-click on the button again and select Assign Macro.

Assign Macro to Recalculate Button in excel

  • In the Assign Macro window, enter the macro name as RecalculateActivesheet and click OK.

Assign macro window


Step 5 – Test the Recalculate Button

  • Click the Recalculate button (as shown in the image).

Test the Recalculate Button in Excel

  • The Time Elapsed will be recalculated each time you click the button.


Forcing Recalculation Using Excel VBA

You can also forcefully recalculate the worksheet formulas using VBA code. Follow these steps:

Forcing Recalculation Using Excel VBA

  • Run the following code (press F5 in the module):
Sub ForceCalc(Optional Full As Boolean)
    With Application
        .Calculation = xlCalculationManual
        .Calculation = xlCalculationAutomatic
        If Full Then.CalculateFull
    End With
End Sub

This code was found on Folkstalk.com.

Forcing Recalculation VBA code

  • Select the sheet name in the Macros window and click Run.

  • The Time Elapsed will be updated (as shown in the image).

Read More: How to Force Recalculation with VBA in Excel


How to Refresh an Excel Sheet Automatically

To automatically refresh dataset numbers, use the keyboard shortcut:

  • Take a dataset of random numbers generated by the RANDBETWEEN function (e.g., in cells B5:B15).

.

How to Refresh an Excel Sheet Automatically

  • Press the F9 key to refresh the random numbers automatically.


Download Practice Workbook

You can download the practice workbook from here:


<<Go Back to Excel Calculation Options | How to Calculate in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Fahim Shahriyar Dipto
Fahim Shahriyar Dipto

Fahim Shahriyar Dipto is a graduate of Mechanical Engineering at BUET. With over 1.5 years of experience at Exceldemy, he authored 70+ articles on ExcelDemy. He has expertise in designing worksheets at You’ve Got This Math. Currently, He is a Team Leader at Brainor. Dipto's passion extends to exploring various aspects of Excel. Beyond tech, he enjoys creating engaging kids' worksheets using Illustrator. A dedicated employee and innovative content developer, He incorporates a commitment to academic excellence and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo