Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Feb 17, 2:52*am, vbaseeker wrote:
Please let me know the error in this code with syntax error in function line. [....] Sub Montecarlo() Function callPriceMC(s0 As Double,k As Double, T As Double,r As Double, q As Double, vol As Double, numTrials As Long, seed As Long) As Double [....] *End Function End Sub You cannot nest procedures -- you cannot put a function inside a sub. Simply remove the lines Sub Montecarlo() and End Sub. But I did not bother read, much less test, the function itself to see if there are other errors. I simply confirmed that removing the sub- related lines eliminates all syntax errors, after I correct the lines folded in the posting without continuation characters. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
(Error 1004) Object Defined Error ...simple code | Excel Programming | |||
Problem with code (error code 9) | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
How can I still go to the error-code after a On Error Goto? | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming |