View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mike allen[_2_] mike allen[_2_] is offline
external usenet poster
 
Posts: 85
Default price and yield functions

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