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
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.