By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
 428,529 Members | 864 Online + Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,529 IT Pros & Developers. It's quick & easy.

# IRR function

 P: 2 Hi. I have a working APR quotation system that uses Excel, dialog boxes and some basic VB. I would like to streamline the process by transferring the IRR function into VB but I am a complete novice. The following information is provided by the user: loan (this is the first value used in the IRR function as a negative value) term (number of months) payments (these are the subsequent values used in the IRR function). In all cases the term will be between 12 and 300 and the payments will be the same each month. I picked up the following code from the Microsoft site but was wondering how I could adjust it to the example above. Expand|Select|Wrap|Line Numbers Sub TestIRR()    Dim Guess, RetRate, Values(4) As Double    Dim Fmt, Msg As String    Guess = 0.1  ' Guess starts at 10 percent.    Fmt = "#0.00"   ' Define percentage format.    Values(0) = -70000   ' Business start-up costs.    ' Positive cash flows reflecting income for four successive years.    Values(1) = 22000 : Values(2) = 25000    Values(3) = 28000 : Values(4) = 31000    RetRate = IRR(Values, Guess) * 100   ' Calculate internal rate.    Msg = "The internal rate of return for these five cash flows is "    Msg = Msg & Format(RetRate, CStr(Fmt)) & " percent."    MsgBox(Msg)    ' Display internal return rate. End Sub Thanks for looking Tina xx Sep 11 '07 #1
Share this Question
2 Replies

 Expert 5K+ P: 8,434 As far as I can tell, the IRR function works the same in Excel and VB6. What version of VB are you using, and what seems to be the problem? Sep 12 '07 #2

 P: 2 I'm using VB 6.3. On the example shown each value is shown separately. As the values that I would be using are all the same and the time periods are usually very long (between 12 and 300), is there any way I can use a loop? Thanks for looking Sep 17 '07 #3

### Post your reply

Sign in to post your reply or Sign up for a free account. 