Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jun 2006
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Protecting/Unprotecting (2000 sr-1)

    Is there a way to do a "protect sheet" (or unprotect sheet) to multiple sheets at the same time instead of going through and doing it one-by-one?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Protecting/Unprotecting (2000 sr-1)

    Not manually, but you could use a macro. See for example <post:=321,917>post 321,917</post:> or the thread starting at <post:=387,912>post 387,912</post:>.

  3. #3
    Star Lounger
    Join Date
    Jun 2006
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Protecting/Unprotecting (2000 sr-1)

    Thanks again Hans! I used the following code from the thread you referenced. Now I can just select from the VB declerations whether I want to "Protect" or "Unprotect" and click 'Run'. This is something that should definitely be built into later versions of Excel if it's not already.

    Sub RemovePassword()
    Dim i As Long
    Dim strPasswd As String
    strPasswd = InputBox("Enter password to unlock sheets")
    For i = 1 To Sheets.Count
    Worksheets(i).Unprotect Password:=strPasswd
    Next i
    End Sub

    Sub AddPassword()
    Dim i As Long
    Dim strPasswd As String
    strPasswd = InputBox("Enter password to protect sheets")
    For i = 1 To Sheets.Count
    Worksheets(i).Protect Password:=strPasswd
    Next i
    End Sub

Posting Permissions

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