I would like to protect my spreadsheet, but allow user a edit range.
I used following code:
Sheets(wsDestination).Select
ActiveSheet.Protection.AllowEditRanges(1).Delete
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination & " Range
", Range:=Range("G12:Q20")
If I have "ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True" first then the code failed on the last line. It makes sense,
because the spreadsheet already protected.
When I tried last line first, it protects all the spreadsheet.
If I do not uses "ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True" code, then the whole spreadsheet does not protect at all.
Are there anything wrong I did?
Any information is great appreciated,
Bookmarks