To create the button, follow these steps:
- Go to Tools | Macro and click Record New Macro. In Excel 2007, click the Developer tab and then click Record Macro in the Code group.
- Enter ClearCriteria in the Macro Name box (Figure B) and click OK.
- Select A2:P2.
- Press the Delete key.
- Click A2.
- Click the Stop button on the Macro toolbar. In Excel 2007, click Stop Recording in the Code group on the Developer tab.
- Right-click on any toolbar and select Forms. In Excel 2007, click the Insert Command button on the Developer tab.
- Click the command button control under Form Controls (Figure C) and drag it to the spot where you want to place the button in the worksheet.
- Click ClearCriteria in the Macro list and then click OK.
- Right-click the command button and select Edit.
- Change the Button1 caption to Clear Criteria.
- Click anywhere outside the command button.
Now, when the manager is ready to enter new criteria, she simply clicks the Clear Criteria button to delete any previous entries.
Miss an Excel tip?
Check out the Microsoft Excel archive and catch up on other Excel tips.
Help users increase productivity by automatically signing up for TechRepublic's free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.