Users can use the F5 key or a Form Control Button to run a macro to calculate operations within worksheets. In this article, we demonstrate the step-by-step procedures to make a calculate button in Excel.
Step-by-Step Procedures to Make a Calculate Button in Excel
A calculate button requires a macro to be assigned to it. And clicking the button results in running the macro, thus executing the assigned task.
Follow the below section to make a calculate button in Excel.
Step 1: Generating a Macro for a Specific Task
Typical worksheets contain multiple formulas that may require recalculation. Let’s say we have a worksheet that displays the Countdown to an ongoing exam. Now, we want to find the time spent each time we click on the Calculate Button.
- Go to the Developer tab > Visual Basic or ALT+F11 to open the Microsoft Visual Basic.
- Then move to Insert > Module. The module window appears.
- Paste the following macro in the Module.
Sub RecalculateActivesheet()
ActiveSheet.Calculate
End Sub
Read More: How to Create a Macro Button in Excel
Step 2: Inserting and Modifying a Calculate Button
- Hover over the Developer tab.
- Click on Insert (in the Controls section).
- Select Button (Form Control).
- Draw the button as shown in the latter image.
- Drawing a calculate or Form Control Button takes you to the Assign Macro. As it’s not possible to Edit Text or Format of the button after macro assigning, just click OK when the Assign Macro window appears.
- Right click on the button. Select Edit Text from the Context Menu. Give a suitable name (i.e., Calculate) to the button.
- Now, right click on the button to apply Format Control.
- Choose favorable Font, Font Style, Size, and Color form the Format Control Afterward, click OK.
Read More: How to Add Command Button Programmatically with Excel VBA
Step 3: Assigning Macro to Calculate Button
After modifying the button depiction, users need to assign the macro.
- Right click on the button. Choose Assign Macro from the Context Menu.
- The Assign Macro window appears. Choose the existing inserted macro, then click OK.
Read More: How to Create Button to Link to Another Sheet in Excel
Similar Readings
- How to Set Option Button Value in Excel VBA
- Insert Excel VBA Radio Button Input Box
- How to Create Button Without Macro in Excel
- Add Up and Down Buttons in Excel
- How to Change Cell Value Using Toggle Button in Excel
- How to Add Option Button in Excel
- How to Use Option Button in Excel
Step 4: Saving File as Macro Enabled Excel File Extension (.xlsm)
For further use, users need to save the workbook file as an Excel Macro-Enabled Workbook(*.xlsm).
- Move to File > Save As.
- Select the File Type– Excel Macro-Enabled Workbook(*.xlsm).
- Click on Save.
Read More: How to Edit a Macro Button in Excel
Step 5: Testing Calculate Button
After executing Steps 1 to 4, users can test the Calculate Button.
- Return to the worksheet and click on the Calculate You see, Excel recalculates the formulas existing in the active worksheet.
Read More: How to Create & Apply Option Button Click Event in Excel VBA
Things to Remember
- Users can use Shapes instead of Control Button.
- The F5 key works as an alternative to the button.
Download Excel Workbook
Download the below xlsm file to practice with.
Conclusion
This article demonstrates step-by-step procedures to make a calculate button in Excel. The button works as an execution key for an assigned macro. We hope these discussed steps help you to insert a calculate button for yourself.
Related Articles
- How to Add Radio Buttons in Excel
- Radio Button in Excel Without Macro
- How to Group Radio Buttons in Excel
- How to Use VBA Code for Submit Button in Excel
- How to Clear Cells in Excel with Button
- How to Change Color of Toggle Button When Pressed in Excel
- How to Remove a Form Control in Excel
- How to Create Chart Slider in Excel
- How to Make Games in Excel