Skip to main content

Create a Macro Button That Will Clear All of Your Work Within an Excel Worksheet

Joshua earned an MBA from USF and writes mostly about software and technology.

Learn how to create an Excel button to automate clearing cells.

Learn how to create an Excel button to automate clearing cells.

Create an Excel Button to Clear Cells

You may want to clear all your work within a worksheet instead of creating a new sheet. If this is the case, you are in the right place. This article will show you how to easily create a macro button that will clear every row of a workbook excluding the first row. You'll need to keep the first row so you can keep your button handy for its next use.

If you do not have the developer tab (the developer tab is needed in this tutorial) in Excel find out how to make it visible here.

Add Developer Tab

Step 1: Insert a Button

First, click on the developer tab and choose the insert button. From the form control area of the drop-down, choose the button in the first row to the left. The steps are indicated by 1, 2, and 3 in the illustration below.

Inserting a Form Control Button


Next, drag the cursor somewhere in row 1 to create a button. After the outline of the button is drawn the Assign Macro box appears. Click on the record button.

Drag Cursor


Step 2: Start Recording a Macro

Next, the Record Macro window will appear. Name the macro and click OK. You can tell the macro is recording by the square stop button in the bottom left-hand corner of your screen this stop button will stop the macro at any time during recording.

Name Macro and Record


Step 3: Select Area to Be Deleted

For this worksheet, everything below row 1 needs to be cleared when the button is pressed. Start by selecting row 2. Now press Ctrl + Shift + Down arrow. This will select every row below row 1.

Select Area


Step 4: Clear the Area

When all the rows are selected go to the home tab. Find the edit group and click on clear. Next click on clear all.


Step 5: Stop Recording the Macro

Press Ctrl + home to get back to the top of the workbook if necessary and click somewhere in the worksheet to deselect the selected cells. Now click on the stop button to the right of “ready” in the bottom left-hand corner. Now the macro has finished recording and the button that was drawn earlier should appear. When the button is clicked it will clear any formatting or text below row 1.

Formatting the Button

To format the button, right-click on the button and click on Format Control.


When the Format Control window appears, you will be given several options. Each tab option is listed in the table below. Make any necessary changes to format your button.


Closing the Workbook

When using macros in workbooks they must be saved under the file name.XLSM to represent a macros workbook. If the workbook is not saved under this file extension, the macro you created will not function at all. To save, select the File tab then Save As. Select the location to save in and create a file name. Next, find Excel Macro-Enabled Workbook from the “Save as type” dropdown. Now save the workbook.


Additional Resource

Please see the video below titled "Creating a Macro Button to Clear a Whole Worksheet" if you were unable to learn with the article.

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.

© 2018 Joshua Crowder


Joshua Crowder (author) from Tampa, FL on December 02, 2019:

Thanks! I just wanted to show that everything can be deleted if you want.

Farah Kiaei on February 27, 2019:

Great idea that how much is important to clear every row of a workbook excluding the first row.