For Each loop in VBA

Basic Construct


    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets
       MsgBox ws.Name
    Next ws
                                                           




For Each looping throuh and array


    Dim months As Variant
    Dim month As Variant
    months = Array("January", "Febuary", "March")
    For Each month In months
        MsgBox month
    Next month