Results 1 to 2 of 2

Thread: Unprotect All Sheets with Masked Password

  1. #1

    Unprotect All Sheets with Masked Password



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I'm working with a workbook that has many sheets, each protected with the same password. I want to be able to unprotect all the sheets at once only being prompted by the password once. The following code works almost perfectly. It does EXACTLY what I want it to do EXCEPT it doesn't mask the password when I type it in. I know nothing about vba or programming/ coding. I literally copied the following from another forum and inserted it in a module in my file. I've heard things about creating a form and changing the password char to do this, but don't have a clue of what I'm doing. If anyone can help manipulate the following code (I would need something I can literally copy and paste straight up, I'm that ignorant) or give me another method (in exact, idiot steps), that would be extremely helpful! Thanks!

    Sub UnprotectAllSheets()
    Dim ws As Worksheet
    Dim strPwd As String
    Dim strCheck As String
    strCheck = "PASSWORD"
    strPwd = InputBox("Enter Password to Unprotect All Sheets", "Password", "Enter Password")
    If strPwd = strCheck Then
    For Each ws In ThisWorkbook.Worksheets
    ws.Unprotect Password:=strPwd
    Next ws
    Else
    MsgBox "Incorrect Password"
    End If
    End Sub
    Last edited by thomasutra; 2014-01-23 at 10:57 PM.

  2. #2
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    681
    Articles
    0
    Excel Version
    Excel 2010 64bit
    Just an example. If something like this is good enough you could import the userform and module into your project.

    HiddenPassword.xls

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •