+ Reply to Thread
Results 1 to 2 of 2

Password Protect Workaround: Using Macro to act like WS Protect

  1. #1
    Forum Contributor
    Join Date
    04-23-2012
    Location
    Bradford PA
    MS-Off Ver
    Excel 2010
    Posts
    250

    Password Protect Workaround: Using Macro to act like WS Protect

    I have created this simple format to at the moment stimulate the user from gaining access to a certain WS although it can be circumvented pretty easily by them just selecting "Yes":

    Please Login or Register  to view this content.
    All it does is take them to another worksheet if the select "No"

    My intentions would be to take this a step further in which I pull up a Userform which has a textbox for a "Password". If they get the password right it gives them access to the worksheet if they get it wrong it does the same maneuver and sends them back to the "Home" worksheet as shown in the previous code.

    Any help would be appreciated.

    Jared

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Password Protect Workaround: Using Macro to act like WS Protect

    You can certainly do that. One thing to be aware of is if you create a text box you can go to properties and one of your choices is PasswordChar where you can set a character such as ***, so that when someone is typing the password you only see the characters. I think worksheet activate is a good event to use to display the form. If they deactivate the form you could have code run to re-protect the sheet and set the password again.

    Here's some sample code:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by skywriter; 03-31-2015 at 11:44 AM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

+ 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. Protect/Un-protect multiple sheets with password using VBA
    By Max_excel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2013, 02:59 AM
  2. Replies: 2
    Last Post: 01-17-2013, 08:39 AM
  3. How to protect formula & macro protect without password ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2012, 05:24 AM
  4. Protect Sheet & Password Protect Code
    By KLahvic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-13-2009, 04:08 PM
  5. Replies: 2
    Last Post: 07-16-2005, 11:05 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