+ Reply to Thread
Results 1 to 5 of 5

COmmand button requiring password, if password ok, unhide sheet.

  1. #1
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    COmmand button requiring password, if password ok, unhide sheet.

    Good morning happy campers,

    I am looking for a code that will unhide a sheet.

    workbook contains 2 sheets

    Sheet1
    Sheet2

    At the point of creating, Sheet2 is hidden from veiw, to be opened by another party.
    Sheet1 contains a button, that asks for password, if the password is correct, Sheet2 now becomes visible.

    Kind regards in advance galvinpaddy

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: COmmand button requiring password, if password ok, unhide sheet.

    The first thing to understand is that Excel Security is VERY poor. That being said for the average user this may be sufficient. I have written some code and password protected the code in the VB editor - the password is "password" - this will let you see the code - if the code is password protected the average user will not be able to see the code therefore they cannot see the password hidden in the code.
    I have added a button to sheet 1 that opens an Inputbox - it asks for a password - the password is "password". If the user enters the correct password then Sheet2 is made visible. The user will not be able to unhide the worksheet.
    When the workbook opens it hides sheet2 if it is visible and on closing the workbook it checks to see if sheet 2 is visible and if it is it will hide the sheet prior to the workbook being closed. You need to understand this is easy to crack however as I say for the average user it will probably be sufficient.
    In the workbook code
    Please Login or Register  to view this content.
    In a module
    Please Login or Register  to view this content.
    See attached workbook. Remember Excel security is very poor!!!!
    Attached Files Attached Files
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  3. #3
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: COmmand button requiring password, if password ok, unhide sheet.

    Hi Smuzoen,

    Thanks for that, it works a treat.
    In regards to the security aspect - this request isnt to prevent a user deliberately editing sheet2. I aim to capture info on sheet1 at point of production, with another user, who will gather the info from sheet2, at present we have temporary staff who, through lack of knowledge/experience in Excel tend to click random things and delete info to cover their mistake
    so imply put, to avoid the 'Sorry, didnt mean to do that' line i hear so often!

    Again, many thanks for you input, very appreciated!
    galvinpaddy

  4. #4
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: COmmand button requiring password, if password ok, unhide sheet.

    No problem. I was unsure if you were after a secure method for some confidential information. Some people think that Excel is secure however it is far from being secure. If you have any problems or questions just ask. Glad I could help.

  5. #5
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: COmmand button requiring password, if password ok, unhide sheet.

    Solved & Rep added.
    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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