Adding a "CLEAR" button to the worksheet

G

Guest

On my worksheet I would like to add a"CLEAR" button that would delete the
contents of multiple cells.
 
K

keithl816

Go to View/Toolbars/Control Toolbox/Click on the command button icon and
place on the sheet.

Right click the button and place this code into it (Change the cell
reference to the cells you want to affect). Then change the range to
suit.


Code:
--------------------

Sheets("sheet1").Activate
Range("a2,d2,f2,h2").Select
Selection.ClearContents

--------------------


Come out of design view and test. Make sure to test this on a copy.

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top