+ Reply to Thread
Results 1 to 4 of 4

Improve response time for inserting rows in several hundred sections

  1. #1
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Question Improve response time for inserting rows in several hundred sections

    I have a spreadsheet with some code that inserts up to 10 rows at a time into 213 different ranges over about 12 different sheets. It is taking a long time to do it. It takes about 10 minutes to run the code. Is there a way to improve this code so that it only takes a few minutes?
    In the following code, iInsMax is equal to 213.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Improve response time for inserting rows in several hundred sections

    1. Don't select things:
    thing.select
    selection.change
    is equivalent to
    thing.change
    2. Turn calculation and screenupdating off
    3. Post something a bit more comprehensive 'cos it's very difficult to help without context

    CC

  3. #3
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Re: Improve response time for inserting rows in several hundred sections

    I tried doing what you suggested. I combined all of the 3 lines in the for loop into the following line. It still takes the same amount of time, and even about a minute longer...

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Improve response time for inserting rows in several hundred sections

    On a like-for-like comparison, not selecting will save time. Let us assume some other factor has caused the increase you refer to.

    Post an example for help with the second two things.

+ 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