This was taken from this forum. Hope it helps
Option Explicit
Sub Macro1()
ActiveSheet.Unprotect
Selection.Locked = True
Selection.FormulaHidden = False
Range("A24").Select
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Notice that the recorder doesn't display the passwords you entered.
One way of modifying the code is:
Option Explicit
Sub Macro1A
ActiveSheet.Unprotect password:="hi"
range("a1").Locked = True
range("a24").locked = false
ActiveSheet.Protect password:="hi",DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub
LeapingLizard
Bookmarks