+ Reply to Thread
Results 1 to 6 of 6

Password Unhide Sheets

  1. #1
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Password Unhide Sheets

    Hello,

    I have this code to unhide certain sheets. If the wrong password is entered it shows the sheets and them hides them.

    Can this be modified so it doesn't show the hidden sheets if the wrong password is entered?

    Thanks,
    Fred

    Please Login or Register  to view this content.
    Last edited by fredfarmer; 04-16-2019 at 01:50 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,377

    Re: Password Unhide Sheets

    You don’t test the password. What would indicate if it were correct or not?
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: Password Unhide Sheets

    I might have changed the code in the attached trying different ways.

  4. #4
    Forum Contributor
    Join Date
    03-12-2019
    Location
    USA
    MS-Off Ver
    2010
    Posts
    421

    Re: Password Unhide Sheets

    I have the macro attached to the shape 'Unhide Sheets' on the Search sheet.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,377

    Re: Password Unhide Sheets

    In the code in the OP, you use InputBox to ask for a password, pwd. Then, regardless of what is input, correct, incorrect, nothing, or cancel, you just drop through the next lines of code which unhide all the sheets.

    You would need to test immediately after the InputBox to see if a valid password has been input. Either that, or move the code after the point where you try to UnProtect the sheets. But, even then, you have error trapping so that you can test the error code.

    I think you need to rethink the logic of what you are trying to do.

    You do realise that you don't need to make the sheets visible in order to unprotect them, don't you?

  6. #6
    Forum Contributor
    Join Date
    03-22-2017
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: Password Unhide Sheets

    it should be
    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. [SOLVED] Hide Unhide multiple sheets with password
    By 3345james in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2018, 06:35 PM
  2. [SOLVED] How to hide and unhide sheets with a password
    By holli in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2016, 12:03 AM
  3. [SOLVED] Hide and unhide sheets with a password
    By Saturn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2016, 09:59 AM
  4. Hide all sheets (very hidden) except one or Unhide all sheets with password
    By wmdriver in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2015, 07:21 AM
  5. VBA Startup Password to unhide specific sheets
    By newbie4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2013, 07:09 PM
  6. Password to unhide sheets
    By lfhomet in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2009, 06:58 AM
  7. different password to unhide the hidden sheets.
    By Rahul Nagar in forum Excel General
    Replies: 6
    Last Post: 11-24-2008, 01:56 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