+ Reply to Thread
Results 1 to 18 of 18

Excel 2007 : Macro - loop slows down

Hybrid View

  1. #1
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Macro - loop slows down

    Possibly something like:
    ThisWorkbook.Sheets("MGN Detail").Range("ERCopyRange").Calculate
    That exact syntax will work. It doesn't turn calculation back on for that range, but it does calculate it once with all dependencies. However, what you'd actually do, for the reasons previously described, is
    rERC.Calculate
    See Help for the Calculate method.
    Entia non sunt multiplicanda sine necessitate

  2. #2
    Registered User
    Join Date
    05-19-2010
    Location
    San Diego, California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro - loop slows down

    Everything seems to run extremely well now. The only issue I am having is that the calculation in the code truncates everything to 2 decimals. Any ideas?

    Thanks.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Macro - loop slows down

    The code doesn't truncate anything. Change the formatting to General.

  4. #4
    Registered User
    Join Date
    05-19-2010
    Location
    San Diego, California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro - loop slows down

    So the formatting of the cells in the workbook matter?

    I am displaying cells in the workbook with only two decimals, but they have much higher precision. The format of the cells the macro is copying are currencies.

    When the macro finishes, all the copied data is truncated to two decimals.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Macro - loop slows down

    Having no idea what's in your workbook, I could only speculate. Maybe you have Precision as displayed ticked.

+ 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