+ Reply to Thread
Results 1 to 9 of 9

password protect 4 sheets out of 6 to restrict access

  1. #1
    Forum Contributor
    Join Date
    10-18-2012
    Location
    new york
    MS-Off Ver
    Office 365
    Posts
    177

    password protect 4 sheets out of 6 to restrict access

    Hi,
    I have a workbook with 6 tabs. The workbook is designed to be shared but I want to password protect the last 4 sheets so that they can only be accessed by certain people. The people who have access need to be able to edit the sheet.
    Is there a way to do this? I can't seem to find a simple way.

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: password protect 4 sheets out of 6 to restrict access

    you can use the environ(username) comand in VBA
    Regards,
    amotto

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Contributor
    Join Date
    10-18-2012
    Location
    new york
    MS-Off Ver
    Office 365
    Posts
    177

    Re: password protect 4 sheets out of 6 to restrict access

    ok thanks...how do i do this?
    thank you

  4. #4
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: password protect 4 sheets out of 6 to restrict access

    well you would first need to get the username of each person you want to be able to access the data. In order to do that you need to open excel on your computer, hold Alt+F11 this will bring up the vba editor. Then go to view--> immediate window. This should put a box at the bottom of your screen. in that box type ?environ("username") and hit enter. The gives you the name of the user so that you can specify who will be able to edit your page. you need to do this for each individual you want to edit the page, or have them do it and email you the name. Next you will want to double click on the first page that you want to protect, in the vba editor window, should be on your left. if you don't see it go to view project explorer. if you are unfamiliar with vba let me know and we will work some code for you, hopefully tonight.

  5. #5
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: password protect 4 sheets out of 6 to restrict access

    I have worked up a little code for you, here it is, you will have to add it to every sheet that you want to conditionally lock based on the user's name.

    Please Login or Register  to view this content.
    Let me know if this will work for you.
    Last edited by amotto11; 03-20-2013 at 10:18 PM.

  6. #6
    Forum Contributor
    Join Date
    10-18-2012
    Location
    new york
    MS-Off Ver
    Office 365
    Posts
    177

    Re: password protect 4 sheets out of 6 to restrict access

    Thank you so much, by username is this just something I can make up? Can I give out the same username and password to each person? Thank you!

  7. #7
    Forum Contributor
    Join Date
    10-18-2012
    Location
    new york
    MS-Off Ver
    Office 365
    Posts
    177

    Re: password protect 4 sheets out of 6 to restrict access

    i am trying to input the code but am getting stuck. i just need one password for everyone...is this possible? i don't know how to write it

  8. #8
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: password protect 4 sheets out of 6 to restrict access

    Your username is the computers identity, so you will have to have a different username for each individual that you would like to be able to edit the document.

    The password is just something to lightly protect your workbook, if you did not have this then any user would be able to activate the sheet and then manually unprotect it. I suggest protecting it with some sort of password so that you cannot just unprotect the sheet without one.

    To write this code, all you have to do is know your username and the usernames of all of the users that you would like to edit the document. Remember it is not based on the individual, it is based on the computer name, so if you want to edit this document at home or something you will need to include your computers name there. I have explained above how to acquire the username.

    To insert my code all you have to do is push Alt+F11. then double click the sheet that you want to keep users from editing, they should all show up on the left side of the screen. When a blank screen shows, just copy the code that i gave you and past it in that blank screen. You will then need to change the usernames from my defaults, and/or add more users. Then I would suggest changing the password to something more challenging to crack and something that you can remember.

    Let me know if you do not understand.

  9. #9
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: password protect 4 sheets out of 6 to restrict access

    If i have helped you please mark your thread as solved. My signature shows the steps on how to do this. If you need more help, please feel free to ask.

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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