How to clear content from unprotected Field

A

Amean1

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..
 
G

Gord Dibben

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
 

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