Results 1 to 2 of 2

Protection Issues on a Sheet

Threaded View

  1. #1
    Registered User
    Join Date
    05-16-2018
    Location
    Newcastle Maitland
    MS-Off Ver
    365
    Posts
    8

    Protection Issues on a Sheet

    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.
    Last edited by Dessy277; 11-20-2022 at 02:48 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Protection of Spreadsheet protection
    By Missions Conseils in forum Excel General
    Replies: 3
    Last Post: 11-22-2012, 12:03 PM
  2. Excel 2010 - Copying sheet with protection manually, protection stays... not with VBA
    By AdamParker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2012, 12:38 PM
  3. protection
    By tofimoon4 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-26-2009, 04:15 AM
  4. Semi-Protection Want Hidability AND Protection
    By mbf1999 in forum Excel General
    Replies: 1
    Last Post: 11-17-2007, 01:24 PM
  5. Protection
    By Neight in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-21-2007, 05:47 PM
  6. Replies: 4
    Last Post: 05-02-2006, 11:55 AM
  7. Protection
    By ryanmhess in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2005, 05:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1