+ Reply to Thread
Results 1 to 5 of 5

RATE error in vba

  1. #1
    Forum Contributor
    Join Date
    01-18-2005
    Posts
    238

    RATE error in vba

    I am trying to do the following

    PI_Rate = Rate(Amortization, ExpectedPayment, -LoanAmount) * 12


    each of the 4 variables are dim as double for data type


    I am trying to put this value in a text box, and when I run the code it debugs with the following error

    run-time error '5'
    invalid procedure call or argument

    and the yellow highlights the above line

    when i place the mouse over the following, these are the values

    pi_rate = 0
    amortization = 360
    expectedpayment = 850
    loanamount = 100000

    could someone please help me

    thank you



    Josh

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    I am not sure to fully understand ...
    Are you after an effective annual rate ...?
    What is the PI_rate ...?
    HTH
    Carim


    Top Excel Links

  3. #3
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Put the negative in front of the payment amount, rather than the loan amount.

  4. #4
    Forum Contributor
    Join Date
    01-18-2005
    Posts
    238

    thanks Jason

    it worked perfect,

    may I ask why it is the loan amount in an excel sheet function and the amount of payment in vba that you place the negative?


    thanks


    Josh

  5. #5
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Actually, on a worksheet, you can use the negative in either the payment or present value. I'm not sure why VBA doesn't like the negative on the present value.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1