+ Reply to Thread
Results 1 to 5 of 5

Worksheets hidden dependant on password used to open workbook

  1. #1
    Registered User
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    9

    Worksheets hidden dependant on password used to open workbook

    Hi All,

    I'm hoping to once again tap into the vast excel forum brain for help.

    I have a workbook with 20 worksheets. What I would like to do is password protect the workbook as normal, but, have multiple passwords to open. When opened certain worksheets will be hidden dependant on the password used.

    e.g.

    Password entered is: SALES
    Worksheets visable = 1-10

    password entered is: ADMIN
    Worksheets visable = 1-20

    I have been scouring the web for an answer and have got close but not close enough.

    Hoping you can help

    Regards

    SBG1

  2. #2
    Registered User
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Worksheets hidden dependant on password used to open workbook

    Can anyone help with this or is it not possible.

    Thanks

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Worksheets hidden dependant on password used to open workbook

    Hi scooterboygnu1,

    I am assuming you get the Secondary Password using VBA of some sort. The following can easily be integrated with your VBA code. If this is NOT the case, please post a sample workbook, and I can integrate my code into your sample workbook.

    The following code will hide all Sheets except:
    a. SALES - Sheets 1 to 10
    b. ADMIN - Sheets 1 to 20
    c. OTHER - Sheet 1 (Excel requires that at least one sheet be visible)

    Lewis

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-06-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Worksheets hidden dependant on password used to open workbook

    Thanks for the response Lewis. If I could take you up on the offer to intergrate into the attached example sheet I would be grateful? The green worksheets are to be viewed when "Sales" is entered and the User Guide can be sheet that remaing visible.

    Thanks again.

    SBG1
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Worksheets hidden dependant on password used to open workbook

    Hi,

    Try the attached workbook. When the workbook opens, only the 'User Guide' sheet is displayed. I added a 'Shape' in the 'User Guide' Sheet that requests the Secondary Password and Displays the appropriate sheets after the Secondary Password is entered. It is simple, and allows multiple retries.

    I modified the routine to display or hide the Worksheets based on the Secondary Password (case insensitive):
    'ADMIN' - Display all sheets
    'SALES' - Display only sheets with green tabs (colorindex 43)
    Otherwise - Display on sheet 'User Guide'

    Lewis

    ThisWorkbook code follows:
    Please Login or Register  to view this content.

    Ordinary Module 'ModDisplayOrHideSheets' code follows:
    Please Login or Register  to view this content.

+ 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. Change worksheets on view when password entered to open workbook
    By scooterboygnu1 in forum Excel General
    Replies: 3
    Last Post: 07-03-2014, 05:55 AM
  2. [SOLVED] EXCEL 2003 - Password to open hidden sheet
    By kevshim in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-19-2013, 12:20 PM
  3. Open Workbook if closed, keep open if open, insert password
    By jwahl16 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-09-2013, 04:09 PM
  4. [SOLVED] Password array to open all password protected workbook in a folder
    By rename in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-07-2012, 05:06 AM
  5. Password Protect Hidden Worksheets?
    By MAMC84 in forum Excel General
    Replies: 2
    Last Post: 03-04-2008, 07:51 PM

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