+ Reply to Thread
Results 1 to 6 of 6

EXCEL VBA USERFORM- PASSWORD PROTECTION for worksheets, workbook and code

  1. #1
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    EXCEL VBA USERFORM- PASSWORD PROTECTION for worksheets, workbook and code

    I have a userform that needs 3 levels of password protection. First there are 5 users of this userform.

    1) The first level is for the 3 people that need userform access only(they are to have no spreadsheet access).
    2) The second level is for 1 person who should be able to access the userform and "sheet 3" only(sheets 1 & 2 need to be blocked from this user).
    3) The last level is all access for myself (administrator access).

    I have attached my workbook!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: EXCEL VBA USERFORM- PASSWORD PROTECTION for worksheets, workbook and code

    To get things started, use this link to create your password userform.

    http://www.davesexcel.com/apps/blog/...enter-password

  3. #3
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: EXCEL VBA USERFORM- PASSWORD PROTECTION for worksheets, workbook and code

    Thanks, but I don't see how this gives me the three levels I am looking to acheive.

  4. #4
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: EXCEL VBA USERFORM- PASSWORD PROTECTION for worksheets, workbook and code

    you could try to edit my code in this thread:

    http://www.excelforum.com/excel-prog...fic-users.html

  5. #5
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: EXCEL VBA USERFORM- PASSWORD PROTECTION for worksheets, workbook and code

    No the password box needs to open as soon as they click on the file folder. The first level user would after typing in his passowrd go directly to the userform access only(they are to have no spreadsheet access). The second level user after typing in his password would go to the userform and be able to see "sheet 3" only(sheets 1 & 2 need to be blocked from this user). The third level is all access for myself (administrator access).

    I attempted to lock the project and that password came up too late so I unlocked it. There has to be a way to do this.

  6. #6
    Registered User
    Join Date
    04-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: EXCEL VBA USERFORM- PASSWORD PROTECTION for worksheets, workbook and code

    Attempted below but did not work....

    Option Explicit

    Sub ShowForm()
    Const PW As String = "secret"

    If InputBox("Enter password to continue") = PW Then
    frmINVENTORY.Show
    Else: MsgBox "Wrong password"
    End If
    End Sub

+ 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