ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Making a template with reset button (https://www.excelbanter.com/excel-discussion-misc-queries/13738-making-template-reset-button.html)

Lisa

Making a template with reset button
 
I am helping a co worker with a form that is used every day. It has formulas
in it and I am locking those cells and protecting the sheet to prevent the
form from being altered. Is there an easy way to put a button on the sheet
or toolbar that can be hit and it will clear the unprotected cell
information-thus putting it back to a blank field?


Gord Dibben

Lisa

Sub DeleteUnlockedCells()
Dim rngeCell As Range
Application.ScreenUpdating = False
For Each rngeCell In ActiveSheet.UsedRange.Cells
If rngeCell.Locked = False Then rngeCell.ClearContents
Next
Application.ScreenUpdating = True
End Sub


Gord Dibben Excel MVP

On Thu, 17 Feb 2005 13:45:01 -0800, "Lisa"
wrote:

I am helping a co worker with a form that is used every day. It has formulas
in it and I am locking those cells and protecting the sheet to prevent the
form from being altered. Is there an easy way to put a button on the sheet
or toolbar that can be hit and it will clear the unprotected cell
information-thus putting it back to a blank field?




All times are GMT +1. The time now is 08:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com