+ Reply to Thread
Results 1 to 3 of 3

Any suggestions for speeding up this loop

  1. #1
    Registered User
    Join Date
    12-18-2015
    Location
    irvine
    MS-Off Ver
    2010
    Posts
    2

    Any suggestions for speeding up this loop

    I currently have a vba loop that takes a very long time to finish iterating through the rows about (5000) and it is becoming an issue since it is used in a report that is used several times throughout the day and was wondering what optimizations I can do to speed things up.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Any suggestions for speeding up this loop

    Here's a modified version that may help a bit

    - Row_Number and total_rows should be type 'Long' rather than 'Double'; ditto for variable i
    - A 'With Sheets(2)' option will simplify the code and avoid determining that reference so often.
    - Adding the 'Application' options should speed it up significantly if you did not have that already.
    Please Login or Register  to view this content.
    If this has been helpful, please click on the star at the left.

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Any suggestions for speeding up this loop

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Last edited by LeoTaxi; 12-18-2015 at 06:52 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Speeding up a loop to repeat calculations for different inputs
    By violeta14 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2015, 06:02 AM
  2. Suggestions for speeding up macro run time
    By niccio2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-30-2014, 01:39 PM
  3. Speeding up For loop
    By ryanarbabi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-06-2014, 07:45 PM
  4. Help speeding up a for loop
    By msfarrar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2012, 02:52 PM
  5. [SOLVED] Speeding up loop code
    By Mrowe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2012, 11:43 AM
  6. speeding up a loop
    By menos in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-08-2011, 09:49 AM
  7. Speeding up the Execution of an SQL query in a VBA loop?
    By gimiv in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2007, 03:31 PM

Tags for this Thread

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