For Each Statement
SyntaxGroupFor Each var In items statements Next [var]
Flow ControlDescription
Execute statements for each item in items.
See Also
Parameters Description var This is the iteration variable. items This is the collection of items to be done.
Do, For, Exit For, While
Sub Main Dim Document As Object For Each Document In App.Documents Debug.Print Document.Title Next Document End Sub