+ Reply to Thread
Results 1 to 5 of 5

Is it necessary to pause Macro for Excel to finish Autocalculation

  1. #1
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Is it necessary to pause Macro for Excel to finish Autocalculation

    Hi,

    I am a newbee to VBA. Need your help to clarify below:

    I have a large spreadsheet with lot of complex formulas. Auto calculation option is already on. It takes few seconds for excel to update the formulas/values after each entry.

    I have created a macro to loop through all entries and copy the result to another sheet.

    So, wanted to know if I need to pause the macro for excel to finish auto calculations after each entry or this will be done automatically.

  2. #2
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Is it necessary to pause Macro for Excel to finish Autocalculation

    Nothing VBA happens during calculate. You can often expedite macro operateiions by setting application.calculation = xlManual, doing stuff that may make the data out of date but does not depend on the result then resetting to application.calculation = xlAutomatic before you end the macro,
    Most things in Excel are synchronous - meaning here tha tthey run in turn. Excel queries by default run in the background but you can disable that to make VBA wait before continiung.
    Last edited by brynbaker; 11-18-2012 at 12:19 PM.

  3. #3
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Is it necessary to pause Macro for Excel to finish Autocalculation

    Hi, Thanks for your reply!

    I dont want the VBA to happen during calculation.

    Just want to make sure that the final result that I copy to another sheet with the help of macro, should only be AFTER excel finished the autocalculation.
    Macro should not copy the result cells before/in between the excel auto calculation in process.

  4. #4
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Is it necessary to pause Macro for Excel to finish Autocalculation

    I'm sorry I was not clear; VBA waits (as you must) during every calculation. That is what you want to know.

    The other information was to explain that you suspend calculation until it is essential then run it, while vba waits, in may cases.

  5. #5
    Forum Contributor
    Join Date
    08-23-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Is it necessary to pause Macro for Excel to finish Autocalculation

    Great...Thanks for your help!

+ 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