vba continue for each loop code example
Example 1: vba continue for each loop
For i = LBound(Schedule, 1) To UBound(Schedule, 1)
If (Schedule(i, 1) < ReferenceDate) Then
PrevCouponIndex = i
Goto NextIteration
End If
DF = Application.Run("SomeFunction"....)
PV = PV + (DF * Coupon / CouponFrequency)
NextIteration:
Next
Example 2: for each loop vba
Private Sub Constant_demo_Click()
fruits = Array("apple", "orange", "cherries")
Dim fruitnames As Variant
For Each Item In fruits
fruitnames = fruitnames & Item & Chr(10)
Next
MsgBox fruitnames
End Sub