+ Reply to Thread
Results 1 to 6 of 6

How to hide certain sheets with password

  1. #1
    Registered User
    Join Date
    11-16-2011
    Location
    Copenhagen
    MS-Off Ver
    Excel 2003
    Posts
    2

    How to hide certain sheets with password

    Hello

    I´m trying to achieve the possibility to hide some sheets with a password, but not all.

    I found this thread:
    http://www.excelforum.com/excel-prog...-password.html

    Where all the sheets are hidden with a password, but since I'm not a coder, I´m not able to get some of the sheets to be hidden and some visible by default.

    The workbook has this:
    Please Login or Register  to view this content.
    and the module:

    Please Login or Register  to view this content.
    Hope someone can help me.
    Attached Files Attached Files
    Last edited by marcielo; 11-17-2011 at 11:21 AM. Reason: Forgot to attach file

  2. #2
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: How to hide certain sheets with password

    I would go about it by having a worksheet called "usernames" that is always xlSheetVeryHidden.

    Please Login or Register  to view this content.
    And then in column A store the usernames and in column B store the passwords. (Username can be the name of the worksheet you are hiding.)

    So have a userform popup with 2 different entries. 1 for the username and 1 for the password.

    Search the hidden worksheet by looping through each value in column A. (http://www.mrexcel.com/td0058.html)

    Please Login or Register  to view this content.
    See what you can do with the above. It is pseudocode so it won't work but should help you get started.

    Tutorial:
    Please Login or Register  to view this content.
    Option explicit means you have to define all your variables as a data type.
    So "Dim someVariable As String"
    means you made a variable called someVariable and it will hold data of the type "String".

    The next line means for each worksheet in the workbook you will check the sheets. If the first worksheet is not the first sheet then you hide it. Repeat and check all the worksheets.

    The final line saves it.

    If you want to select which sheets are hidden or not hidden you need to change that code.

    Please Login or Register  to view this content.
    Hope this gives you a good start.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to hide certain sheets with password

    Have a look at the password form
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    11-16-2011
    Location
    Copenhagen
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: How to hide certain sheets with password

    Thank you for the replies

    111StepsAhead: Without your help I would not have achieved - thanks a lot!!

    royUK: Thank you for the file, but unfortunately I was not able to access the code, cause it wants me to enter a password no matter what I do.

    Thank you again for taking the time!!!

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

    Re: How to hide certain sheets with password

    hi marcielo,
    as an option
    open the Roy's file with "Manager" and password "secret", or click on the tab name, view code and set to visible the Sheet1!
    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-

  6. #6
    Registered User
    Join Date
    03-08-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to hide certain sheets with password

    Hi Roy, thank you for the file, but when I tried it like in 3 instances the user have entered the wrong password, it says the workbook will now close, but it doenst really close, and to add, every time I close the worksheet, the sheet "hide this sheet" always becomes visible even I tried to put it, sheetveryhidden. thank you.

+ 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