Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect spreadshet, but allow user edit range
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, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect spreadshet, but allow user edit range
This works for me:
ActiveSheet.Protection.AllowEditRanges(1).Delete ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination _ & " Range", Range:=Range("D3:H12") ActiveSheet.Protect DrawingObjects:=True, Contents:=True _ , Scenarios:=True What is the value of wsDestination? Regards Rowan "Souris" wrote: 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, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect spreadshet, but allow user edit range
Thanks it works now,
Thanks millions, "Rowan" wrote: This works for me: ActiveSheet.Protection.AllowEditRanges(1).Delete ActiveSheet.Protection.AllowEditRanges.Add Title:=wsDestination _ & " Range", Range:=Range("D3:H12") ActiveSheet.Protect DrawingObjects:=True, Contents:=True _ , Scenarios:=True What is the value of wsDestination? Regards Rowan "Souris" wrote: 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, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can i protect edit links ? | Excel Discussion (Misc queries) | |||
Protect User from edit Control Toolbox (Design Mode) | Excel Discussion (Misc queries) | |||
protect query from edit | Setting up and Configuration of Excel | |||
Spreadshet Help | New Users to Excel | |||
Protect Macro from Edit | Excel Programming |