LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default How to reset all enteries on the worksheet?

Aploogies Dori

I guess I should have wondered why you wanted ALL data cleared.

You just want the constants cleared <doh

This will clear just numerics, which would include dates.

Sub cleardata()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws
.Unprotect Password:="justme"
.Cells.SpecialCells(xlCellTypeConstants, 21).ClearContents
.Protect Password:="justme"
End With
Next ws
End Sub

No error checking. Will crash if no numeric data on a sheet.


Gord

On Thu, 1 Dec 2005 11:30:04 -0800, "DORI"
wrote:

Hi Gord,
Thanks for the code. When I ran the macro, it gave me an error message that
I have to unprotect the sheet (I have protected certain cells with formulas
and info for users). I did that and then my entire worksheet was cleared
including all my formulas in the cells.
Dori

"Gord Dibben" wrote:

DORI

Try this macro.

Sub clearall()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Cells.ClearContents
Next n
Application.ScreenUpdating = True
End Sub


Gord Dibben Excel MVP

On Wed, 30 Nov 2005 19:32:02 -0800, "DORI"
wrote:

Thank you so much FinRazel. I followed your instructions and it worked. My
only question is if this works only for the active worksheet. It would be
great if I could apply this to the entire workbook to clear multiple
worksheets with one click.
Dori

"FinRazel" wrote:

Try This:
Add dummy data everywhere you want deletable.
Go to Tools-Macro-Record New Macro
Name your macro, click OK
Holding down Ctrl, click everywhere you will delete, this will highlight
them all at the same time.
Hit the delete key
Stop recording your Macro (the little box button on the record macros toolbar)
Add a button to you worksheet using the Forms Toolbar.
Right-click on the button, click "assign macro"
Highlight your new macro.

Your good to go.
--
Anne Murray


"DORI" wrote:

Is it possible to press a cell on the worksheet to clear all entered data in
the entire worksheet?
I have a worksheet that users enter several data in different pages and then
print a report. The next user will have to clear all eneries and then enter
their own data before printing the next report. At this time, we close the
program and reopen it which is a bit of pain, just wondering if we could
create a key (let call it "Reset all Forms" on the worksheet to press and
clear all data.
I appreciate any comments in advance.
Dori






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM


All times are GMT +1. The time now is 06:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"