Clear data button for workbooks

T

takatross

Does anyone know how to create a button or tab that you can click on, in
the workbook, that will delete data in the worksheets.

I've made an overtime tracking spreadsheet that calculates hours over a
14 week period. (14 worksheets) However, after the quarter or 14 week
period is over I currently have to go back and delete all the data
hours in the workbook in order to start a new 14 week period. I'd like
to create one button(cell) that I can click on that will clear all data
for me. Any ideas or advice?

thanks,

tim
 
P

Paul B

Tim, how about clicking the square above the 1 and next to the A to select
all cells and press delete?

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
D

Debra Dalgleish

One solution is to create a template that you can reuse:

1. Make a copy of your spreadsheet, and delete all the data
that will change each month.
2. Choose File>Save As
3. Type a name for the template, e.g. Overtime
4. From the 'Save as type' dropdown, choose Template (*.xlt)
The file name will change to an .xlt extension.
5. The template folder should automatically appear in the 'Save in'
dropdown at the top of the dialog box.
6. Click Save
7. Close the template.

At the start of the next 14 week period, choose File>New.
If you're using Excel 2002, from the Task Bar, under Templates, click on
'General Templates', select your template, and click OK.
 
P

Paul B

Tim, after reading Debra's post I see where you might not want to "clear all
data", just to give you another option you could select all the cells you
want to clear and name them, insert, name, define and then use something
like this with the defined name as My_Range, and assign it to a button.

Sub Clear_Data()
Range("My_Range").ClearContents
End Sub

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
Paul B said:
Tim, how about clicking the square above the 1 and next to the A to select
all cells and press delete?

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 

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