+ Reply to Thread
Results 1 to 5 of 5

Super slow Insert Columns with 40,000 lines of records

  1. #1
    Registered User
    Join Date
    02-03-2011
    Location
    Richmond, BC
    MS-Off Ver
    Excel 2007
    Posts
    69

    Super slow Insert Columns with 40,000 lines of records

    Hi,

    I am experiencing super slow and some time crashing insert columns with 40,000 lines of records.
    I am just wondering, is there better way around this?

    Here's the code that's giving me issue.
    Please Login or Register  to view this content.
    I have tried using Range("E1:E40000").Insert... but still no luck of speeding things up or avoiding crashing Excel 2010.

    Any suggestion?


    Thank you very much

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Super slow Insert Columns with 40,000 lines of records

    Typically, if anything CAN be done, it will be in reducing the column-calcs associated with the sheet. Suggestions:

    1) Turn off Automatic Calculation in your workbook prior to the insert so the formulas won't try to recalc on their own

    2) Remove all the Conditional formatting you can from your workbook.

    3) With the Conditional Formatting that is left, consider removing it, then reapplying new rules to the sheet ensuring all the cells are highlighted as you recreate each new CF formula, this ensures only one rule is created for the entire range. Again, the less of this, the better, when performance is the goal.

    4) Highlight all the empty cells below your data range and do a CLEAR ALL. (ALT-e-a-a)
    (do the same with all empty cells to the right of your data)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-03-2011
    Location
    Richmond, BC
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Super slow Insert Columns with 40,000 lines of records

    Quote Originally Posted by JBeaucaire View Post
    Typically, if anything CAN be done, it will be in reducing the column-calcs associated with the sheet. Suggestions:

    1) Turn off Automatic Calculation in your workbook prior to the insert so the formulas won't try to recalc on their own

    2) Remove all the Conditional formatting you can from your workbook.

    3) With the Conditional Formatting that is left, consider removing it, then reapplying new rules to the sheet ensuring all the cells are highlighted as you recreate each new CF formula, this ensures only one rule is created for the entire range. Again, the less of this, the better, when performance is the goal.

    4) Highlight all the empty cells below your data range and do a CLEAR ALL. (ALT-e-a-a)
    (do the same with all empty cells to the right of your data)

    Hi JBeaucaire,

    Thank you for the suggestion.
    However, my source data does not have any formula or conditional formatting in them at all.
    They are just value data, some with date format.

    I have tried the Clear All method. It's a bit faster but still took some time to completed.

    Here's the code that's in between the two inserts.
    Please Login or Register  to view this content.
    Please let me know if there's anything other than suggested that would speed up the process.


    Thank you very much

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Super slow Insert Columns with 40,000 lines of records

    Quote Originally Posted by stewegg View Post
    I am experiencing super slow and some time crashing insert columns with 40,000 lines of records.
    I don't get surprised because when the data in the subsequent columns are huge then it takes some time to re-allocate the data's since the newer versions have bunch of columns and rows

    One suggestion from my end keep the file in Binary Format and check


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Super slow Insert Columns with 40,000 lines of records

    You could restructure your data into a worksheet array and then build it in core, get your boundaries and just dump it onto the sheet
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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. [SOLVED] Need help with an excel file that is super slow and crashes a lot.
    By regorih in forum Excel General
    Replies: 6
    Last Post: 01-14-2014, 07:23 PM
  2. 2003 code runs super slow in 2010
    By emanresu65 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 01-04-2013, 05:25 PM
  3. Tons of Arrays = Super Slow Calculating
    By danmarsh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2012, 01:52 PM
  4. speeding up code that is super slow
    By cabinetguy in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 05-19-2011, 12:24 PM
  5. Excel 2007 : Super Slow Excel Label Printing Format
    By bsteoh in forum Excel General
    Replies: 0
    Last Post: 02-11-2010, 09:18 AM

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