ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to clear content from unprotected Field (https://www.excelbanter.com/excel-worksheet-functions/118439-how-clear-content-unprotected-field.html)

Amean1

How to clear content from unprotected Field
 
Is there any way to clear unprotected content from the sheet that also
contains formulas in protected fields quickly rather than going column
by column and delete unprotected data?

Thanks for any help that you can provide..


Gord Dibben

How to clear content from unprotected Field
 
One way is with a macro.

Sub UnlockedCells()
Dim wk As Worksheet
Dim cl As Range
For Each cl In wk.UsedRange
If cl.Locked = False Then
cl.ClearContents
End If
Next
Next
End Sub

This assumes that you have sheet protection set with option "select unlocked
cells" checked.


Gord Dibben MS Excel MVP

On 11 Nov 2006 07:05:48 -0800, "Amean1" wrote:

Is there any way to clear unprotected content from the sheet that also
contains formulas in protected fields quickly rather than going column
by column and delete unprotected data?

Thanks for any help that you can provide..




All times are GMT +1. The time now is 02:28 AM.

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