Hey everyone

I`m trying to calculate the implied volatility (could only be found with the Newton Raphson Algorithm) of Call/Put Options and for that I`ve to use VBA. The thing is that in the VBA code I somehow have to tell the programme to use one type of formula for the call and another for the put option. Correspondingly, the 2 formulas need to be written in the VBA code and the variables in them have to be defined. In my case it`s the Black-Scholes formula and I wrote it explicitly in the VBA code. I tried to formulated some code but it seems not to work.
My mistake is probably with the defining of the variables....actually in my Excel worksheet I`ve a column for each one of the variables and the column is called exactly like the variable. The range is also given in the code, because I`m not sure how the VBA will know up to where to calculate the values.
Furthermore, after I`ve written the code I`ve pressed F5 which is supposed to show me the value of the implied volatility in the corresponding column in the Excel worksheet but nothing appeared there. Maybe I just don`t know what to do after I write my code, I`m reading the whole time about macros in Excel/VBA but I`ve no idea to what extent I need them in this case.

So it would be more than great to hear from you.........and to read your comments on my code. Thank you in advance for the help, guys!

Here`s my VBA code:

Please Login or Register  to view this content.