How to Create a Button in Microsoft Excel That Opens a Calculator
The Windows Calculator
In this tutorial we look at how to activate the default Windows calculator form an Excel spreadsheet. This trick is for all of you Microsoft users that want to have the advantage of having a short cut for frequent calculator use. That is, if you can stand using the Windows calculator. It only takes a few steps to add a macro to a button to complete the setup. With that in mind, let’s get started.
Activate the Developer Tab
To have access to the tools that allow you to create a button you must enable the developer tab on the Excel ribbon. If you will need to do this if you want to follow along and complete each step. To learn how to add the developer open up this link in another browser tab.
Adding the Developer Tab
Microsoft Excel Developer Tab
Select a Button a to Add to the Spreadsheet
To add a button to the spreadsheet, click on the developer tab in the ribbon. Navigate to the controls section and select the insert button. Choose the button in the upper left-hand corner of the form controls section as shown in the illustration below.
Draw a Box
Immediately after the button is clicked you need to draw an outline of a square of a rectangle with your cursor to complete the creation of the button. This will determine the size and location of the button. To do so, left click on your mouse and hold the button while you drawl your shape. Once this is complete a new window will appear.
Assign the Macro
Assign Macro Code to the Button
After the assign macro window appears, choose a name for your macro and select the new button. Doing so will open the Microsoft Visual Basic for Applications window. Here you can add the code located below that will activate the windows calculator application. Make sure that you keep the first line of codes where your button name appears and disregard the first line of code below.
After the code is inserted into the Visual Basic application, the Visual Basic window can be closed.
Add the Visual Basic Code
Changing the Label of the Button
To change the label on your button left clicking on the default text in the button and your cursor will appear in the button allowing you to edit. For this example I’d like to change the name of my button button label to Calculator so people know that it will call up a calculator. To change other properties of the button right click on it and choose format control. This will give you all of the design tools available to change the text design of button and make other property changes.
Saving the Excel Workbook as a Macro-Enabled Workbook
In order for assigned macro to function, the workbook must be saved as a macro-Enabled Excel workbook. To do so, click on the file tab and select save as. You can see and example of this selected highlighted in the illustration below. saving make sure you save the workbook with the selection outlined in red in the illustration below.
Save as a Macro-Enabled Workbook
To learn more about using Excel macros for business applications I recommend the following book. I have been using the Excel Bible for years to improve my understanding of all aspects of this Microsoft product.
The Excel 2019 Bible
Crowder, J. (2020, January 1). How to Add the Developer Tab in Excel. Retrieved January 1, 2020, from https://youtu.be/nskuG6pK5ig.
This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.
Questions & Answers
© 2019 Joshua Crowder