Hi Everyone
Hoping someone could point me in the right direction.
I have a sheet where I want to lock down certain aspects of it;
- All columns are to remain the same width, eg no resizing, unhiding etc
- Rows 1-7 are to be fully locked down, only editable by macros
- After rows 8 onwards, I would like to give the user as much functionality as possible, eg: Delete rows, Resize rows, Add rows, filters, grouping, sorting.
I have the following code, which for some reason works on a new blank sheet however doesnt allow for delete rows etc on the sheet I need to use it on. On the sheet I am trying to use it on I have Named Ranges, Grouping, Hidden Columns, Styles, Conditional Formatting, Merged Cells. Not really sure what of this could be effecting it?
Code below:
Sub Protectsheet()
ActiveSheet.Range("A1:S6").Locked = True
ActiveSheet.Range("A6:S2000").Locked = False
ActiveSheet.Protect Password:="Password", DrawingObjects:=True, Contents:=True, Scenarios:=True, _
UserInterfaceOnly:=True, AllowFormattingCells:=True, AllowFormattingColumns:=False, _
AllowFormattingRows:=True, AllowInsertingColumns:=False, AllowInsertingRows:=True, _
AllowInsertingHyperlinks:=True, AllowDeletingColumns:=False, AllowDeletingRows:=True, _
AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
End Sub
Any additional advice on how to enable as much functionality on the lower cells would also be kindly appreciated.
Thanks in advanced.
Bookmarks