+ Reply to Thread
Results 1 to 3 of 3

Big excel file with vba, slow processing

  1. #1
    Registered User
    Join Date
    12-28-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    2

    Big excel file with vba, slow processing

    Hi guys,

    I've got a problem. I have an excel file with around 200,000+ rows with around 30 columns. This file contains functions such as IF, AND, OR as well as certain functions that I have written as there are certain cells that required my own formulas. Without any automation, the file size is around 12 mb.

    I am trying to automate the entire process and now I have gotten up to around the 25th column and the process is starting to look really slow and bleak as the file size has increased to around 40mb.

    Is there anyway by which I can make make the code more efficient? The current code I am using is:


    Please Login or Register  to view this content.
    ----

    I am pretty much a noob in VBA, but as you can see everytime I run this code, the GCDnm formula will be pasted all through the J column. This process is repeated for all the rows and different columns have different code. Is there a way by which I can do it in a more efficient way? i.e. everytime a new line is added onto the 200,000++ lines of data the code doesn't have to paste the formula for the entire column??

    Sorry for the long post! Many thanks!
    Last edited by lukeckh; 12-28-2013 at 05:32 AM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Big excel file with vba, slow processing

    Hello and Welcome to the Forum,

    Whenever you are putting formula via vba, we should (usually) turn off calculations until the macro is done so that it doesn't keep starting to calculate over and over and over again each time you add a new formula (which sometimes happens).

    Try this:

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Big excel file with vba, slow processing

    Hi,

    Thanks for your question regarding ScreenUpdating. I didn't want to just throw information at you so I didn't elaborate at why I turned it off at the beginning of the code, but didn't turn it on again at the end. Simply put, Excel will do this regardless whether or not I tell it to once the macro reaches 'End Sub'. Therefore there's no real reason to tell Excel to do if it's going to do it anyways. As for the others, if you don't tell them to revert to the original state, then they will remain turned off.

    Hope this helps.

    abousetta

+ 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. Windows XP : Processing response time very slow
    By Thembinkosi in forum Microsoft Windows Help
    Replies: 3
    Last Post: 05-14-2011, 10:38 AM
  2. Slow processing
    By burugudug in forum Excel General
    Replies: 2
    Last Post: 04-16-2010, 12:05 AM
  3. Slow processing
    By epal31nz in forum Excel General
    Replies: 1
    Last Post: 10-10-2009, 11:38 PM
  4. slow processing with .find
    By Guy Normandeau in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-14-2006, 01:45 PM
  5. Slow Macro Processing
    By Janene_P in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2005, 04:48 PM

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