+ Reply to Thread
Results 1 to 8 of 8

Monte Carlo Simulation VBA Code

  1. #1
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Monte Carlo Simulation VBA Code

    Hi, I have the following VBA code (see below), because of it I believe all my formulas in the rest of my spreadsheet are not working at all, I have deleted the VBA code yet the formulas are still not working, please can you help me?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,099

    Re: Monte Carlo Simulation VBA Code

    Hi, nav505,

    where in the code do you set the Calculation back from manual to automatic? If nowhere that would explain why your formulas do not "work" (should do by pressing F9). Maybe check in the Options if the Calculation is still set to Manual and switch it back to Automatic.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Re: Monte Carlo Simulation VBA Code

    Ho do I check in the options?

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,099

    Re: Monte Carlo Simulation VBA Code

    Hi, nav505,

    youīre kidding?!

    Excel2010: Data / Options / Formulas / Calculation / Calculation Options.

    In VBA: go to the Immediate Window, type in
    Please Login or Register  to view this content.
    Either True (what I doubt) or False will be delivered when entered. To change in the VBE just enter
    Please Login or Register  to view this content.
    Ciao,
    Holger

  5. #5
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Re: Monte Carlo Simulation VBA Code

    Hi, it is still not working, when I type in the code neither True or False is delivered, but Print is

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,099

    Re: Monte Carlo Simulation VBA Code

    Hi, nav505,

    Quote Originally Posted by nav505
    Ho do I check in the options?
    Whatīs not working with my answer regarding Excel2010?

    Please Login or Register  to view this content.
    Or you use -4145 instead of xlCalculationAutomatic (I prefer the constant over the number - easier to remember for me).

    Ciao,
    Holger

  7. #7
    Forum Contributor
    Join Date
    02-10-2013
    Location
    Wolverhampton
    MS-Off Ver
    Excel 2010
    Posts
    101

    Re: Monte Carlo Simulation VBA Code

    I have inserted the code Sub TurnItOnAgain(), but the formulas are still not working automatically, only when I select Automatic on the Calculations Options, that they work, but I do not want to have to click on Automatic everytime from the Calculation Options tab

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,099

    Re: Monte Carlo Simulation VBA Code

    Hi, nav505,

    itīs this line of code which always puts the calculation back to manual:
    Please Login or Register  to view this content.
    As long as that line is stuck inside the code you will have to either comment that line out, call the TurnItOnAgain macro at the end of the code or think about why the calculation needs to be turned to manual on every calculation (which I donīt know because I canīt remember to have written any script of this kind).

    Ciao,
    Holger

+ Reply to Thread

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.6.0 RC 1