price and yield functions

M

mike allen

How do you use the price and yield functions in code? I tried:

Sub testyield()
Cells(1, 1) = Application.yield(Cells(2, 1), Cells(3, 1), Cells(4, 1),
Cells(5, 1), 100, 2, 0)
End Sub
obviously, the inputs are settlement, maturity, rate, price, etc. that work
on spreadsheet.

Do I have to activate these functions somehow? I do have to enable analysis
tool pak in order to use functions such as these on a spreadsheet, but what
about code?

Thanks, Mike Allen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top