+ Reply to Thread
Results 1 to 6 of 6

VBA - passw protect multiple sheets with select unlocked cells on every sheet

  1. #1
    Registered User
    Join Date
    10-08-2021
    Location
    Belgium
    MS-Off Ver
    Office365
    Posts
    3

    VBA - passw protect multiple sheets with select unlocked cells on every sheet

    Hi,

    New member as of today! And this is my first post...probably not my last.

    I have a workbook with 12 sheets that I would like to password protect using a button.
    I found this VBA script online and protects all my sheets but all cells are unselectable.
    On all sheets, I have to be able to select unlocked cells. I've added "s.EnableSelection = xlUnlockedCells" myself in the script but without success.
    I've searched online and in this form but couldn't find a solution.

    What do I need change in the script?
    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. You should also indent your code to show control structure. --6StringJazzer[/COLOR]
    Last edited by 6StringJazzer; 10-08-2021 at 11:35 AM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,012

    Re: VBA - passw protect multiple sheets with select unlocked cells on every sheet

    Not alot to correct the posted macro. It just goes in circles.

    Here is a different approach :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-08-2021
    Location
    Belgium
    MS-Off Ver
    Office365
    Posts
    3

    Re: VBA - passw protect multiple sheets with select unlocked cells on every sheet

    Hi,

    Thanks for the reply!. Your code works but just one thing is strange. After I run the protectAll code, the frame that shows the active cell, is visible on every sheet but the worksheet that was active during the run. Even after clicking several times in the active worksheet. If I go to one of the other worksheets and than return to the original active worksheet, the frame is back.
    Last edited by sxd0126; 10-08-2021 at 03:52 PM.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,012

    Re: VBA - passw protect multiple sheets with select unlocked cells on every sheet

    I am unable to reproduce those results here.

    ????

  5. #5
    Registered User
    Join Date
    10-08-2021
    Location
    Belgium
    MS-Off Ver
    Office365
    Posts
    3

    Re: VBA - passw protect multiple sheets with select unlocked cells on every sheet

    Hi, I can't send you my file. When I strip all the data I can't share, this problem doesn't occur anymore. Weird
    I noticed that the issue doesn't appear when the file is closed (after protecting it) and reopend. So my end users won't be affected.

    You solved my problem. Thank you!!

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,012

    Re: VBA - passw protect multiple sheets with select unlocked cells on every sheet

    Glad you have an answer !

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 09-11-2014, 07:28 AM
  2. [SOLVED] How do you protect multiple sheets while only allowing users to select unlocked cells?
    By mrssteelerhall in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2013, 02:05 PM
  3. [SOLVED] Disabling 'select unlocked cells' using macro when protecting multiple Worksheets
    By tigerbenn in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-25-2012, 09:26 AM
  4. [SOLVED] Protecting every sheet and not allowing to select locked or unlocked cells
    By doubl3d80 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2012, 12:42 PM
  5. Replies: 2
    Last Post: 06-28-2010, 05:26 PM
  6. Protect worksheet code - allow unlocked cell select
    By Paul DK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2007, 08:44 AM
  7. Replies: 2
    Last Post: 03-29-2005, 06:06 AM

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