![]() |
Protected Worksheets with info that needs to be deleted.
Excell 2003. I have a worksheet that is protected, and people are allowed to
input data in the non-protected cells. Is there any way too highlight the whole worksheet and delete the information that is in the non-protected cells with out deleted the formulas in the protected cells? |
Protected Worksheets with info that needs to be deleted.
Try this
Sub ClearUnlockedCells() Dim myRange As Range Dim r As Range Dim aWS As Worksheet Set aWS = ActiveSheet Set myRange = Nothing For Each r In aWS.UsedRange If Not r.Locked Then If myRange Is Nothing Then Set myRange = r Else Set myRange = Union(myRange, r) End If End If Next r If Not myRange Is Nothing Then myRange.ClearContents End If End Sub -- HTH, Barb Reinhardt If this post was helpful to you, please click YES below. "Joe Clark" wrote: Excell 2003. I have a worksheet that is protected, and people are allowed to input data in the non-protected cells. Is there any way too highlight the whole worksheet and delete the information that is in the non-protected cells with out deleted the formulas in the protected cells? |
Protected Worksheets with info that needs to be deleted.
Where do I input this information?
"Joe Clark" wrote: Excell 2003. I have a worksheet that is protected, and people are allowed to input data in the non-protected cells. Is there any way too highlight the whole worksheet and delete the information that is in the non-protected cells with out deleted the formulas in the protected cells? |
Protected Worksheets with info that needs to be deleted.
Alt F11
Insert a module Paste this in. Barb Reinhardt "Joe Clark" wrote: Where do I input this information? "Joe Clark" wrote: Excell 2003. I have a worksheet that is protected, and people are allowed to input data in the non-protected cells. Is there any way too highlight the whole worksheet and delete the information that is in the non-protected cells with out deleted the formulas in the protected cells? |
Protected Worksheets with info that needs to be deleted.
I posted the info into the module, how do I run the module?
Thanks "Barb Reinhardt" wrote: Alt F11 Insert a module Paste this in. Barb Reinhardt "Joe Clark" wrote: Where do I input this information? "Joe Clark" wrote: Excell 2003. I have a worksheet that is protected, and people are allowed to input data in the non-protected cells. Is there any way too highlight the whole worksheet and delete the information that is in the non-protected cells with out deleted the formulas in the protected cells? |
Protected Worksheets with info that needs to be deleted.
Select the sheet you want to update. Press F8. Run the macro.
Barb Reinhardt "Joe Clark" wrote: I posted the info into the module, how do I run the module? Thanks "Barb Reinhardt" wrote: Alt F11 Insert a module Paste this in. Barb Reinhardt "Joe Clark" wrote: Where do I input this information? "Joe Clark" wrote: Excell 2003. I have a worksheet that is protected, and people are allowed to input data in the non-protected cells. Is there any way too highlight the whole worksheet and delete the information that is in the non-protected cells with out deleted the formulas in the protected cells? |
All times are GMT +1. The time now is 10:39 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com