Results 1 to 3 of 3

Big excel file with vba, slow processing

Threaded View

  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:


       dim lastrow as long
    
        lastrow = Cells(Rows.Count, "B").End(xlUp).Row
    
        '~~> Change this to the relevant sheet name
        '~~> This is the sheet where the formula will go
        Set wsRawData = ThisWorkbook.Sheets("Raw Data")
    
        Set wsALD = ThisWorkbook.Sheets("AData")
        
        
        '---------This section begins Great Circle Distance in nm---------'
        
        With wsRawData
    
             Range("J6:J" & lastrow).Formula = "=GCDnm(D6,E6)"
    ----

    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.

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