Emmily
Well-known Member
- Joined
- Oct 5, 2008
- Messages
- 676
Hi, i have the following parameters for workbook protection. Now if i make this True
, AllowDeletingRows:=True _
then the user can delete all rows. I would like to limit to what they can delete.
So how can i add to this so that the user is able to delete rows for wks "Test1" and Test2" from range "C7:X1000" only?
, AllowDeletingRows:=True _
then the user can delete all rows. I would like to limit to what they can delete.
So how can i add to this so that the user is able to delete rows for wks "Test1" and Test2" from range "C7:X1000" only?
Code:
Public Sub protectSheet(ByRef wks As Worksheet, ByVal strPW_Wks As String)
wks.Protect _
Password:=strPW_Wks _
, DrawingObjects:=True _
, Contents:=True _
, Scenarios:=True _
, UserInterfaceOnly:=False _
, AllowFormattingCells:=False _
, AllowFormattingColumns:=True _
, AllowFormattingRows:=True _
, AllowInsertingColumns:=False _
, AllowInsertingRows:=False _
, AllowInsertingHyperlinks:=False _
, AllowDeletingColumns:=False _
, AllowDeletingRows:=True _
, AllowSorting:=True _
, AllowFiltering:=True _
, AllowUsingPivotTables:=False
End Sub