Excel: Using VBA to force recalculation-VBForums
Results 1 to 4 of 4

Thread: Excel: Using VBA to force recalculation

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2004
    Location
    Right here
    Posts
    205

    Excel: Using VBA to force recalculation

    Hi all,

    Does anyone know how to make Excel recalculate the worksheets via VBA? It can be done in the actual workbook by pressing the F9 key but there doesn't seem to be a corresponding "recalculate" function in the VBA section.

    It would need to be able to run as part of a macro located in a standard code module.

    Thanks
    -Rob
    http://www.sudsolutions.com

  2. #2
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: Excel: Using VBA to force recalculation

    When I recorded a macro pressing F9 the word "Calculate" appeared.
    That help?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2004
    Location
    Right here
    Posts
    205

    Re: Excel: Using VBA to force recalculation

    Code:
    Application.Calculate
    That seems to work. Does anyone know if it re-calculates all worksheet formulas? I actually need the code because I am using the RAND() function and need to run an analysis using a variety of randomly generated values, but I don't want the whole worksheet to recalculate i.e. no need for the rest of the formulas in the workbook to recalculate, just the RAND() functions.

    Thanks
    -Rob
    http://www.sudsolutions.com

  4. #4
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: Excel: Using VBA to force recalculation

    I think you can use calculate on specific ranges, so if you know where your RAND() functions are you should be set.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.