Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA macro to calculate loan

Status
Not open for further replies.

danahome76

Technical User
Dec 26, 2005
1
CH
hello to all and thank you for taking the time to read my message; please anyone could help me with this problem I have to solve real quick; I have to create a button named "calcul" which displays the number of years needed to pay back a loan with a fixed interest rate when the annual pay back amount is also given.My macro has to automatically calculate year by year the loaned amount , the interest rate and the rest to be payed.I have to use the following variables:
Dim annee As Integer 'Year of pay back
Dim montant As Currency 'Amount of the loan
Dim taux as Single 'Inretes rate-percentage
Dim versement As Currency 'Annual pay back
Dim interet as Currency ' Interest for the current year
Dim reste As Currency 'Amount left to be payed


Also I have to use the following

While montant>0 'As long as the borrowed amount is not null

....
Wend
 
Excel can do this without a macro. Have a look at the NPER function.

If you must have a macro to do this then I suggest that first you do the calculations in a workbook using formulae. Then check the answer using NPER. Then convert it to code. If you can't get the code running properly then post back with the code you have tried and someone will help you.


Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top