+ Reply to Thread
Results 1 to 6 of 6

Worksheet Protection

  1. #1
    Registered User
    Join Date
    07-11-2011
    Location
    England
    MS-Off Ver
    Office 2019
    Posts
    58

    Worksheet Protection

    Hi guys, I have a quick query....

    I have a worksheet with many complex formluas in order to achieve a pricing sheet. Some of these cells are unlocked - others are locked (but selectable).

    My question is this - i have approx 92 different sheets over 14 workbooks that need this protection - do I need to do the boring and mundane task of, hold ctrl, click, drag, release, repeat etc etc, lock - and then repeat, or can I copy the same cell protection over many sheets?

    Thanks!
    M

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Worksheet Protection

    Hi,

    Not necessarily

    If the range of cells is the same on each sheet, or if they're different but there's some rule which can be applied to find them, then a simple macro to loop through all sheets and set the range would do the trick.

    e.g. - assuming all cells are the same. (Will need modification if not)
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-11-2011
    Location
    England
    MS-Off Ver
    Office 2019
    Posts
    58

    Re: Worksheet Protection

    Hey,

    I've never used Macros in a spreadsheet before - any help with this? Also the cells are the same on every sheet, but the unlocked cells are all over the place with individual cell references (rather than a more simple A1:B2, which I assume can be selected with eg A1, A2, B1, B2 etc)

    Thanks

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Worksheet Protection

    Hi,
    I probably misled you, and others, since by definition when you switch on sheet protection all cells are locked by default unless you have specifically unlocked them. My example macro should have said ..... Locked = False.

    I should have asked the obvious. Are you wanting to unlock all cells that are NOT formulae? If so just use the F5 (Goto) key, pick Special and then Constants. This will select all those cells. Then just format them as Unlocked.

    Is there anything about the cells that you want to unlock that can be identified or worked out. e.g. are they or their text always the same unique colour, are they always x rows and y columns away from some other identifiable cells, or some other rule.
    For instance what's the manual process you would go through to achieve this and is that easily written down in a logical way.

  5. #5
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Worksheet Protection

    Try this:

    Please Login or Register  to view this content.
    From your active workbook, hit the keys ALT+F11. Insert a module by Right-clicking on the workbook name in the navigation pane on the left. Select "Insert" -> "Module". Paste the above code into this module. Then put your cursor in the pasted code and go to "Run" -> "Run Sub/Userform"

  6. #6
    Registered User
    Join Date
    07-11-2011
    Location
    England
    MS-Off Ver
    Office 2019
    Posts
    58

    Re: Worksheet Protection

    Hi, thanks for the replies.

    Some cells are, and some aren't formulas unfortunately!

    I feel like I have to do a big repeat of locking soon lol

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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