I tried to use method A instead of method B to speed up the loop process in function, but in the massive fx calculation did not significantly accelerate, do you know why?
VBA Code:
Dim lot_now As Long
Method A:
Dim lot_chk As Long
lot_chk = 0
rtn_chk:
If lot_now > 10 Then
step = 10
Else
step = 2
End If
If amt - lot_now * rate < min_cost And lot_now > 0 Then
If lot_now = lot_chk Then
lot_now = lot_now - 1
GoTo fx_exit 'exit loop
End If
lot_now = lot_now - step
GoTo rtn_chk
Else
lot_now = lot_now + 1
lot_chk = lot_now
GoTo rtn_chk
End If
Method B:
Do While amt - lot_now * rate < min_cost And lot_now > 0
lot_now = lot_now - 1
Loop