Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Amortization of a loan in VBA

Posted on 1997-11-29
7
Medium Priority
?
1,208 Views
Last Modified: 2008-03-04
Could someone give me a web page address were I can find a code on VBA regarding Loan Amortization Calculation. If you already  have a code please post. Thank you.
0
Comment
Question by:gima
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 5

Expert Comment

by:dirtdart
ID: 1442874
VBA contains several financial functions.  FV is the one I use most.  It returns the future value of a loan based on the information given.

FV(rate,nper,pmt,pv,type)

Rate   is the interest rate per period.
Nper   is the total number of payment periods in an annuity.
Pmt   is the payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes.
Pv   is the present value, or the lump-sum amount that a series of future payments is worth right now. If pv is omitted, it is assumed to be 0 (zero).
Type   is the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
PMT will figure the monthly payment on a loan given the requested information.

PMT(rate,nper,pv,fv,type)

Rate   is the interest rate for the loan.
Nper   is the total number of payments for the loan.
Pv   is the present value, or the total amount that a series of future payments is worth now; also known as the principal.
Fv   is the future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0.
Type   is the number 0 (zero) or 1 and indicates when payments are due.

There is also PV, IPMT, NPER, PPMT, RATE, and several others.  The documentation for them can be found in vb help, or Excel help, and I'm sure it's in the other Office help files too.
0
 

Author Comment

by:gima
ID: 1442875
Can you be a more specific. I need to get a vba code for amortization of a loan. Thank you.
0
 
LVL 8

Accepted Solution

by:
mrmick earned 200 total points
ID: 1442876
The following code will display what you're looking for in your immediate window.

'Play the following constants
Const AnnualIntRate = 9.25 'Percentage
Const AnnualPayments = 12
Const TotalPeriods = 48 '4 Year Loan
Const LoanAmount = 20000

Dim r As Double
Dim l As Long

   r = (AnnualIntRate / 100) / AnnualPayments
   For l = 1 To TotalPeriods
      Debug.Print "PMT# "; CStr(l); ")  "; Format(pmt(r, TotalPeriods, -LoanAmount), "##0.00"); "    ";
      Debug.Print "Int: "; Format(IPmt(r, l, TotalPeriods, -LoanAmount), "##0.00"); "  ";
      Debug.Print "Prn: "; Format(PPmt(r, l, TotalPeriods, -LoanAmount), "##0.00"); "  "
  Next


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:mrmick
ID: 1442877
Depending on where you intend to run the code, the "Debug.Print" may need to be changed to reflect where you'd like to see the output of this example.

0
 

Author Comment

by:gima
ID: 1442878
But The person can choose to pay biweekly(26),weekly(52) or
Twice a month. Can you change a code?
0
 
LVL 8

Expert Comment

by:mrmick
ID: 1442879
Just make the changes in the following:

Const AnnualPayments = 12
Const TotalPeriods = 48 '4 Year Loan

For example:
Const AnnualPayments = 52 'Weekly
Const TotalPeriods =  AnnualPayments * 5 'Number of Years Here

'TotalPeriods = AnnualPayments * ? (Years) assumes all loans will be in Years only, Just set TotalPeriods for any fraction of year(s).
0
 

Author Comment

by:gima
ID: 1442880
Thank you.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question