May 11 2021 02:07 AM
I have created 2 Name Managers i.e opex (blue colour) and mtd (green). Using a macro, I would like to unlock these areas (Name manager) and lock the rest (other cells) so that users can key in their data in the unlocked cells.
Previously, I recorded a macro (object based using mouse) for implementation for 50 Excel files and had some inconsistent results. Sometime, in using the macro, I find these cells are either fully locked, partially locked or unlocked. Is there another way to do this, consistently?
May 11 2021 03:48 AM
SolutionFor example:
Sub UnlockNamedRanges()
Cells.Locked = True
Range("opex").Locked = False
Range("mtd").Locked = False
ActiveSheet.Protect ' Password:="secret"
End Sub
May 11 2021 03:48 AM
SolutionFor example:
Sub UnlockNamedRanges()
Cells.Locked = True
Range("opex").Locked = False
Range("mtd").Locked = False
ActiveSheet.Protect ' Password:="secret"
End Sub