A Alberto Ast Sep 19, 2009 #1 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?
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?
P Per Jessen Sep 19, 2009 #2 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
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
J Jacob Skaria Sep 19, 2009 #3 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
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