+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    12-04-2008
    Location
    melb
    Posts
    6

    Using Existing NORMSDIST() Function in VBA

    My entire current function for my Black Scholes Calling Price Model is

    Code:
    Function BlackScholesCallOption(Stock As Double, Exercise As Double, Time As Double, Interest As Double, Sigma As Double)
    
    Dim a As Single
    Dim b As Single
    Dim c As Single
    Dim d1 As Single
    Dim d2 As Single
    
    a = Log(Stock / Exercise)
    b = (Interest + 0.5 * Sigma ^ 2) * Time
    c = Sigma * (Time ^ 0.5)
    d1 = (a + b) / c
    d2 = d1 - Sigma * (Time ^ 0.5)
    BlackScholesCallOption = Stock * NormSDist(d1) - (Exercise * Exp(-Interest * Time)) * NormSDist(d2)
        
    End Function

    The only problem is that my NormSDist functions that i use in the second last line is not defined. I need help defining it so that it pulls from the excel function normsdist().

    Thanks in Advance.
    Last edited by glade; 05-10-2009 at 07:10 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944

    Re: Using Existing NORMSDIST() Function in VBA

    You would need to access the worksheet function like this
    Code:
    application.WorksheetFunction.NormSDist(d2)
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Guru VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    12,009

    Re: Using Existing NORMSDIST() Function in VBA

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    12-04-2008
    Location
    melb
    Posts
    6

    Re: Using Existing NORMSDIST() Function in VBA

    i love you man,

    thanks so much!

  5. #5
    Forum Guru VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    12,009

    Re: Using Existing NORMSDIST() Function in VBA

    glade,

    Please add the link to the cross post

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    05-18-2009
    Location
    Johannesburg
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Using Existing NORMSDIST() Function in VBA

    NORSDIST and NORMINV are not the same.

    Masese

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0