Question : vba continue for each loop
Answered by : innocent-ibis-xtvpp7mhfhwx
For i = LBound(Schedule, 1) To UBound(Schedule, 1) If (Schedule(i, 1) < ReferenceDate) Then PrevCouponIndex = i Goto NextIteration ' <- Key code End If DF = Application.Run("SomeFunction"....) PV = PV + (DF * Coupon / CouponFrequency) '....' 'a whole bunch of other code you are not showing us' '....' NextIteration: ' <- Key code
Next
Source : https://stackoverflow.com/questions/8680640/vba-how-to-conditionally-skip-a-for-loop-iteration | Last Update : Fri, 08 Jan 21