tools
01-05-2009, 06:40 AM
Hi all,
After protecting my sheet I am not able to insert or delete any rows.
The problem is with the ScrollArea property that I am using in my code.
If I remove the ScrollArea property and protect my sheet I am able to insert or delete rows.
Is there any solution to this ?
Sub Protectsheet()
Worksheets(1).ScrollArea = "A:Z"
Worksheets(1).Unprotect
Worksheets(1).range("A1:B15").Locked = True
Worksheets(1).Protect DrawingObjects:=True, Scenarios:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, AllowInsertingRows:=True, AllowDeletingRows:=True, AllowFiltering:=True
End Sub
Thanks & Regards
After protecting my sheet I am not able to insert or delete any rows.
The problem is with the ScrollArea property that I am using in my code.
If I remove the ScrollArea property and protect my sheet I am able to insert or delete rows.
Is there any solution to this ?
Sub Protectsheet()
Worksheets(1).ScrollArea = "A:Z"
Worksheets(1).Unprotect
Worksheets(1).range("A1:B15").Locked = True
Worksheets(1).Protect DrawingObjects:=True, Scenarios:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, AllowInsertingRows:=True, AllowDeletingRows:=True, AllowFiltering:=True
End Sub
Thanks & Regards