Sub Macro1() Dim Z(5) As Double For i = 0 To 5 Z(i) = 0.1 * i * i Next dp = 1 End Sub Sub Macro2() Dim Z(5) As Double For i = 0 To 5 If i = 5 Then Exit For End If Z(i) = 0.1 * i * i Next dp2 = 2 End Sub Sub Macro3() Dim Z(5) As Double For i = 0 To 5 Z(i) = 0.1 * i * i Next For Each Zi In Z Debug.Print Zi Next dp = 3 End Sub