+ Reply to Thread
Results 1 to 18 of 18

Password protecting an individual sheet in a workbook

  1. #1
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Password protecting an individual sheet in a workbook

    Hey guys.

    I'm working on a big workbook for my company. I want all staff to able to input there work on this workbook on certain sheets. I then have other sheets that are calculating salaries and commissions. These sheets are extremely sensitive and I don't want the staff having access to this info. I know you can hide sheets but Is there a way to password protect sheets.

    Nitro.

  2. #2
    Forum Contributor
    Join Date
    01-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    227

    Re: Password protecting an individual sheet in a workbook

    Quote Originally Posted by Nitro2481 View Post
    Hey guys.

    I'm working on a big workbook for my company. I want all staff to able to input there work on this workbook on certain sheets. I then have other sheets that are calculating salaries and commissions. These sheets are extremely sensitive and I don't want the staff having access to this info. I know you can hide sheets but Is there a way to password protect sheets.

    Nitro.
    Hi,

    So this looks simple to me.

    First hide all of the Sensitive Sheets and then Click 'Protect Workbook' button and provide a password.

    This will disable the unhiding Sheets option.

    Hope this answers your query.
    If I've been of help, plz add reputation.

  3. #3
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Password protecting an individual sheet in a workbook

    Hi sakmsb,

    Will the staff still be able to input on the other sheets without the protect workbook password?

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Password protecting an individual sheet in a workbook

    Roy UK has a very useful file, just try it and see if it helps you!
    http://www.excelforum.com/excel-prog...-workbook.html
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  5. #5
    Forum Contributor
    Join Date
    01-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    227

    Re: Password protecting an individual sheet in a workbook

    Quote Originally Posted by Nitro2481 View Post
    Hi sakmsb,

    Will the staff still be able to input on the other sheets without the protect workbook password?
    i hope you meant *WITH the protect workbook password?

    yes, they will be able to..
    Last edited by sakmsb; 10-21-2014 at 01:27 PM.

  6. #6
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Password protecting an individual sheet in a workbook

    Sakmsb

    That does work but there are about 3 sensitive cells involved and it means I have to manually unhide them each time and then I run the risk of accidentally for getting to rehide them before saving and logging off.
    John 55
    This Roy's one looks like something that may work with differnt codes having different accesss but how do you set that up?

    Thanks for the help
    Nitro

  7. #7
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Password protecting an individual sheet in a workbook

    hi,
    if you want to use it you need to change (in sheet Hide this sheet)the users name and the level.
    i.e
    Jack has level 1, it means he is able to access Sheet Dept1
    Roy has level 2, it means he is able to access Sheets Dept2 and Dept3
    and so on
    you can see the code here:
    Please Login or Register  to view this content.
    you need to test it for yr needs

  8. #8
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Password protecting an individual sheet in a workbook

    Hi John55,

    Thanks a mil for your time and patience, I have a little experience with VBA but that code is boggling me. I wonder if you could show me a quick example. Say I have 5 sheets, Apples, Oranges, Grapes, Profit, Wages. I want all staff when they open the workbook to see Apples, oranges, grapes and when I logon I can see all 5. So I only require 2 access levels. What sheet to you put the VBA in etc
    Nitro

  9. #9
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Password protecting an individual sheet in a workbook

    hi man.
    1st you need to rename the sheets (Dept1,Dept2,Dept3 as what you want)
    I renamed them as: Dept1 as Apples, Dept2 as Oranges, Dept3 as Grapes and added 2 new as Profit and Wages.
    2nd replace the code from the orig file with this one
    Please Login or Register  to view this content.
    also using Manager as user and secret as password you can manage all sheets!
    hope it helps you.
    Last edited by john55; 10-26-2014 at 08:38 AM.

  10. #10
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Password protecting an individual sheet in a workbook

    Hi John,

    You'll be sorry you ever came across this thread. . I have copied that exact formula you gave me and went into sheet 1, view code, paste. Then Sheet 2-6 are named Apples oranges grapes profit wages. assume I have to set the user name and password somewhere (manager, secret). I think your giving metoo much credit here, my VBA is very basic. Sorry

  11. #11
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Password protecting an individual sheet in a workbook

    Hi Nitro,
    I added the test file, this is the original Roy's file and it has "an amended piece of code" with your example posted in post#8
    hope it helps you.
    Attached Files Attached Files

  12. #12
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Password protecting an individual sheet in a workbook

    Hi John,

    I can see that working ok. How do I apply it to my sheet. I viewed the code for each sheet but I cannot see the code you gave me inserted in any sheet, can this be retrospectively applied to a sheet already created or does it have to be set up at the start. I really need some hand holding / step by step on this one. If I could see where the codes have been input I could probably manipulate it to suit me. Do I need to set up a "splash" and "Hide this sheet" sheet. Not sure i'm getting this one. Sorry if I'm wrecking your head. Also I'm on 2003 if that matters?
    Last edited by Nitro2481; 10-26-2014 at 01:34 PM.

  13. #13
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Password protecting an individual sheet in a workbook

    Hi,
    You need to set up a "splash" because when you open the file mandatory you need to have a sheet, a sort of "welcome" or some instructions for users or whatever.
    You need to have a hidden sheet where you manage the users and level.
    The sheets nned to be created/named before and then change the code for your needs.
    To see the code, hit Alt+F11 and you will see in the left side a window, Microsoft Excel Object =your sheets, Forms=your UserForm (in this case is frmPW), if you double click on it you see the form itself, go to menu-View-Code, there is the code.
    in post#8 you said:
    " I want all staff when they open the workbook to see Apples, oranges, grapes" it means case1, and in sheet "Hide this sheet" you see user Jack, password x, level1.
    Please Login or Register  to view this content.
    you can change Jack with what you want and the pass code too.

    "I logon I can see all 5"
    it means case2, and in sheet "Hide this sheet" you see user Roy, pass code y, level2.
    you can change Roy or the pass code too.
    Please Login or Register  to view this content.
    hope it helps you.

  14. #14
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Password protecting an individual sheet in a workbook

    Hi John55

    I think I just about have it. 2 little problems I'm having
    1. How do I hide the "Hide this sheet" sheet. I think it has something to do with this bit of code
    Please Login or Register  to view this content.
    2. I understand that once I log in as manager I see all sheets, I want all staff to see the same few sheets. Each staff member should have the same access then I would have th extra few sheets, I changed Jack to Advisor and changed the password which worked then I deleted roy, y, level 2 but then it causes an error. I assume it has something to do with this bit of code,
    Please Login or Register  to view this content.
    Is it that I only need 1 case?
    Otherwise I have it sussed I think. Thanks so much

  15. #15
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Password protecting an individual sheet in a workbook

    Hi John55

    I think I just about have it. 2 little problems I'm having
    1. How do I hide the "Hide this sheet" sheet. I think it has something to do with this bit of code
    Please Login or Register  to view this content.
    2. I understand that once I log in as manager I see all sheets, I want all staff to see the same few sheets. Each staff member should have the same access then I would have th extra few sheets, I changed Jack to Advisor and changed the password which worked then I deleted roy, y, level 2 but then it causes an error. I assume it has something to do with this bit of code,
    Please Login or Register  to view this content.
    Is it that I only need 1 case?
    Otherwise I have it sussed I think. Thanks so much

  16. #16
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Password protecting an individual sheet in a workbook

    it's ok if you changed case 1 (Jack) to Advisor, pay attention just replace Jack with Advisor in the same cell in sheet "Hide..."
    it's not ok if you deleted Roy and you change the code (case2), here you have two options:
    sign in as Manager/secret and you are able to see all sheets
    sign as george/wahtever pass code- instead of Roy and you are able to see sheets from case2.
    to hide a sheet, Alt+F11, select the sheet and from properties window visible-> select 2 xlSheetveryhidden

  17. #17
    Forum Contributor Nitro2481's Avatar
    Join Date
    09-09-2014
    Location
    Laois, Ireland
    MS-Off Ver
    2013
    Posts
    323

    Re: Password protecting an individual sheet in a workbook

    Hi John

    Finally got there. Thanks a mil for your help and patience

    Nitro

  18. #18
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Password protecting an individual sheet in a workbook

    Hi man,
    Glad to help you!

+ 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. [SOLVED] Trying to put password protection on individual sheets within a workbook
    By crispybadger in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-15-2012, 05:34 AM
  2. Protecting Workbook w/ password using VBA
    By ste_mulv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2009, 11:33 AM
  3. Protecting individual worksheets with a password
    By Nick_in_Dubai in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-13-2009, 04:35 AM
  4. Password protecting individual tabs in Excel 2003
    By WeatherMan in forum Excel General
    Replies: 3
    Last Post: 06-27-2008, 08:00 AM
  5. password protecting sheet when workbook opens
    By mercer77 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2006, 08:44 AM

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