Created
April 24, 2019 06:42
-
-
Save DataSolveProblems/a7dc9353484aa6880ef0dc1ddcf7c0d6 to your computer and use it in GitHub Desktop.
This file contains 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