Created
April 26, 2019 06:16
-
-
Save DataSolveProblems/b8866385fd40e54b66097d39b505f215 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Private Const Password As String = "xyz" | |
Sub Protect_Data_Sheets() | |
Dim ws As Worksheet | |
For Each ws In ThisWorkbook.Worksheets | |
If UCase(ws.Name) <> "SUMMARY" Then | |
ws.Protect Password | |
ElseIf UCase(ws.Name) = "SUMMARY" Then | |
ws.Unprotect Password | |
End If | |
Next ws | |
End Sub | |
Sub Unprotect_All_Sheets() | |
Dim ws As Worksheet | |
On Error Resume Next | |
For Each ws In ThisWorkbook.Worksheets | |
ws.Unprotect Password | |
Next ws | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment