View Single Post
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Another macro for clearing contents of unlocked cells.

Little less code.

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

On 17 Feb 2005 07:07:25 -0800, wrote:

I want to protect some cells in a sheet so that I can just select and
blank the whole sheet while keeping the formulas in some cells intact.
The problem is that, having unlocked the editable cells and protected
the worksheet, when I then select the entire sheet it won't let me just
blank the unlocked cells - it tells me that some cells are protected.
Can anyone please help.