Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Adding Buttons to Your Worksheet.

Adding Buttons to Your Worksheet

Written by Allen Wyatt (last updated March 8, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


Probably the most commonly created control object for worksheets is the lowly button. This is because the most common use of buttons is to run macros which you have associated with a workbook. You can insert buttons in your worksheet by use of the Button tool on the Forms toolbar:

  1. Click on the Button tool.
  2. Click in your workbook where you want a corner of the button to appear, but don't release the mouse button.
  3. Move the mouse to specify the size of the button you want.
  4. Release the mouse button.

Excel immediately displays the Assign Macro dialog box, offering you the opportunity to assign a macro to the button. Notice that the dialog box presents a list of previously defined macros, along with a suggested name for the macro to be assigned to this button. The suggested name is comprised of the default name of the button itself (something like Button1) combined with the action that will start the macro (Click). This macro name (Button1_Click) will appear very familiar to people that have programmed in Visual Basic before, since it conforms to the standard way of naming event handlers. (Event handlers are nothing but programming code designed to handle a specific event, such as an object—like a button—being clicked with the mouse.)

To complete your work with the Assign Macro dialog box, select a macro you want assigned to this new button and then click on OK. You can then change the title appearing on the button by clicking your mouse within the button text and entering a new title.

Once the button is finished in this manner, the macro associated with this button will be run whenever anyone clicks on it with the left mouse button. If you use the right mouse button instead, you will see a menu that allows you to delete the button or change the macro assigned to the button.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2479) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Adding Buttons to Your Worksheet.

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

Tracing Errors

Sometimes it can be confusing to figure out the source of an error that is displayed in your worksheet. Excel provides a ...

Discover More

Changing Column Width

Do you use columns in your document layout? You may want to modify the widths of various columns, and Word makes the ...

Discover More

Using Unique Document Serial Numbers

If you need to include serial numbers in your printed matter (labels, letters, documents, etc.), the best way is through ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (menu)

Searching a Workbook by Default, Take Two

How to create a macro that will display the correct Find and Replace box to set searching parameters.

Discover More

Inserting a Sound File in Your Worksheet

Some worksheets are better understood through the spoken word or with musical accompaniment. Sound files can be easily ...

Discover More

Comparing Lists for Duplicates

Do you have two worksheets on which you need to see if there is duplicate information? Here is a couple of quick ways to ...

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 nine minus 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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