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

Popular posts from this blog

introduction to python CH 01

Day 02 Python - data types , Numbers , Operations , Type Conversions , f-Strings

CH02