The Black-Scholes option
model needs to know the remaining life of an options contract, expressed
as a fraction of a year.
That is the purpose of
the timeleft() function. It determines the number of days between two
dates such as the Entry Date and the Expiration Date, and divides by
365 to express those days as a fraction of a year.
Copy and paste the code
below into the OptionCalcs module, below the words "end function" of
the NORMSDIST() function. Save your Project.
Function timeleft(ByVal dte1 As Date, ByVal dte2 As Date) As
'takes the current date and the expiration date, and returns
the time remaining as a fraction of a year
Dim daysleft As Integer = DateDiff(DateInterval.Day, dte1, dte2)
Return daysleft / 365