Clear cells

  • Thread starter Thread starter Alberto Ast
  • Start date Start date
A

Alberto Ast

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?
 
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
 
Try the below....

Me.Unprotect Password:="dist"
ActiveSheet.Cells.Locked = True
Selection.Locked = False
Selection.SpecialCells(xlCellTypeFormulas, 23).Select
Selection.Locked = True
Selection.FormulaHidden = True
Me.Protect Password:="dist"

If this post helps click Yes
 
Back
Top