Calculating Yield in VBA

JohnAndersen

New Member
Joined
Feb 4, 2011
Messages
10
All,

I am importing raw trade data into excel where I then need to run yield calculations. This is where I am getting hung up. Although there is a yield function in the worksheet there doesn't appear to be anything equivalent when I try to write it up in VBA. The Analysis Toolpak for VBA is loaded and everything but it still won't work.

Does anyone know anything about this? Has anyone done tried to calculate anything similar where they've gotten around this?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
You can *probably* still use evaluate via VBA to calculate utilising the actual worksheet function Yield:

Assume

settlement=A1
maturity=A2
rate=A3
pr=A4
redemption=A5
frequency=A6

Code:
MsgBox Evaulate("Yield(A1,A2,A3,A4,A5,A6)")

I haven't tested this though (don't have anything higher than 2002 at work).
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top