Hi,
I'm trying to unproect and protect my workbook, so that my script can update the cells it needs to within my macro and then reprotect the workbook so that no one can overwritethe formulas.
I've tried the VBA below but it's not quite working, any tips anyone?
Thanks
ActiveWorkbook.FrontSheet.Unprotect Password:="password"
Range("D13:P24").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("D13:P24").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="password". DrawingObjects:=True, Contents:=True, Scenarios:=True
I'm trying to unproect and protect my workbook, so that my script can update the cells it needs to within my macro and then reprotect the workbook so that no one can overwritethe formulas.
I've tried the VBA below but it's not quite working, any tips anyone?
Thanks
ActiveWorkbook.FrontSheet.Unprotect Password:="password"
Range("D13:P24").Select
Selection.Locked = False
Selection.FormulaHidden = False
Range("D13:P24").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect Password:="password". DrawingObjects:=True, Contents:=True, Scenarios:=True