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

VBA01 Copy Resize Variably Sized Ranges

VBA MOD01 Passing Arguments to sub procedures (ByRef , By Val)

PY MOD01 Lecture 01