For each … Next Statement

  1. For Each element in group

    1. [statements]

      1. [Exit For]

      [statements]

    Next [element]

Repeats the group of statments for each element in an array of a collection. For each … Next statements can be nested if each loop element is unique. The For Each…Next statement cannot be used with and array of user defined types.

More:

Example: