为什么此循环在第一次通过后停止?

时间:2019-03-01 22:25:08

标签: excel vba

我希望函数在给定答案之前先循环设置次数。它在第一个循环后停止。在给我答案之前,我希望它经过“ PerInq”循环。我遇到了一系列数学问题,必须连续进行才能获得正确的答案。下面是我的代码:

Function IntFinder(PVLoan, APR, PMT_Freq, Term, PerInq)
n = PMT_Freq * Term
R = APR / PMT_Freq
PMT1 = Pmt(R, n, -PVLoan)
Intrest = PVLoan * R
Prin = PMT1 - Intrest
Bal = PVLoan - Prin
BalSum = 0
For counter = 1 To counter = PerInq
    Intrest = R * Bal
    Prin = PMT1 - Intrest
    Bal = Bal - Prin
    counter = counter + 1
Next counter
IntFinder = Intrest
End Function

0 个答案:

没有答案