I created a named range and then used vba to project this area of the worksheet, but what really happens is that the whole worksheet is protected. What am I doing wrong?
note: PWD is defined as a public const elsewhere
note: protectarea is a named range of a block of cells I want protected.
thx for any help!
note: PWD is defined as a public const elsewhere
note: protectarea is a named range of a block of cells I want protected.
Code:
dim rRange as range
Set rRange = ActiveWorkbook.Sheets("Model").Range("protectarea")
rRange.Locked = True
ActiveSheet.Protect Password:=PWD, userinterfaceonly:=True
thx for any help!