Object Variable Not Set while indexing

asked 2019-09-06 18:31:19 +0200

JackZed gravatar image

updated 2019-09-10 15:34:58 +0200

Function Interest_Declining_Balance(optional OB,optional pmt(),optional purchase(),optional Days() as integer, optional rate) dim Balance as double dim Balance_Due as double dim Sum as integer dim Interest as double dim Months as double

        for i = 1 to UBound(Days)
            Balance = (OB + pmt(i,1)-purchase(i,1))*Days(i,1) 
        next i 

        for a = 1 to UBound(Days)
            Sum = Sum + Days(a,1)
        next a 

        Balance_Due = Balance / Sum
        Months = Sum/30
        Interest = rate/100

        Interest_Declining_Balance = (Balance_Due*Interest*Months)

    End Function
edit retag flag offensive close merge delete

Comments

Please reformat into something more readable, tell us how you call that and ask a question.

Opaque gravatar imageOpaque ( 2019-09-06 18:50:30 +0200 )edit