Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Yearfrac in VBA

Status
Not open for further replies.

sabascal

IS-IT--Management
Aug 20, 2002
85
0
0
GB
Hi All,

I am trying to use yearfrac function in a VBA script and I was wondering what was the proper way to call it .
Any that could help.
Thanks
Seb
===========
Sub test()
a = 38500
b = 38750
c = yearfrac(a, b)
MsgBox c
End Sub
 
Hi sabascal,

Your code is OK, but you need a reference to the Analysis ToolPak VBA Addin. First make sure the AddIn is loaded, then set a reference to it (atpvbaen.xls), then your code should run.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at [url=http://www.vbaexpress.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top