VBA MOD01 For Each to loop through collection (Sheet , Ranges)
Public Sub Protect_All_Sheets()
Dim Sh As Worksheet
For Each Sh In ThisWorkbook.Worksheets
Sh.Protect
Debug.Print Sh.Name
Next Sh
End Sub
Public Sub Un_Protect_All_Sheets()
Dim Sh As Worksheet
For Each Sh In ThisWorkbook.Worksheets
Sh.Unprotect
Debug.Print
Next Sh
End Sub
Comments
Post a Comment