Thread: Clear cells
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen[_2_] Per Jessen[_2_] is offline
external usenet poster
 
Posts: 703
Default Clear cells

Hi

Try this:

Sub UnprotectCells()
ActiveSheet.Unprotect password:="JustMe"
For Each cell In Selection
If cell.HasFormula = False Then
cell.Locked = False
End If
Next
ActiveSheet.Protect password:="JustMe"
End Sub

Regards,
Per


On 19 Sep., 04:44, Alberto Ast
wrote:
I have a range of cells selected... using macros how can I unprotect all
those in the range that do not have formulas on it?