+ Reply to Thread
Results 1 to 2 of 2

Alternative for my extremely slow code?

  1. #1
    Registered User
    Join Date
    03-17-2017
    Location
    Amsterdam
    MS-Off Ver
    2007
    Posts
    14

    Question Alternative for my extremely slow code?

    Hey guys,

    I'm working on a workbook that is all about collecting data to run analyses on it.
    This code comes from 2 source files, from which I copy all data and paste it in 2 different sheets in my data collection workbook(for each source 1 sheet).
    The source file gets updated all the time, with rows being deleted, new rows added into it and existing rows being updated with more accurate information.
    When I update my data collection it's common that I already have rows in my data collection which are present (and updated) in the source file.
    For this reason I add a new colomn (A) with a formula that will always output the same value for a row (even when the row gets updated this value stays the same) before I run the code.

    Now the code should look for this unique code in my data collection, and if present it should replace the row in my data collection with the updated row from the source file. If the value is not yet present in column A in my data collection sheet, it should be added below all existing rows.

    Now I got this *working* code to do this:

    Please Login or Register  to view this content.
    Unfortunately this code operates very very slowly, it takes my computer 15 minutes to completely run it (and thats only for 30k rows, let alone if I will use this file for some time and there will be hundreds of thousants of rows)

    Now I looked all over the internet for alternatives but I can't find it. The closest I came to it was using dictionary's, but I wasn't able to completely figure this out.

    Does someone know a good alternative to complete this task in a shorter amounth of time (without letting my computer crash, something this happens with my current code much to often )?

    Thanks already for taking the time to look into my question

    Kind regards,
    Warmerfare
    Last edited by Warmerfare; 05-26-2017 at 05:14 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,688

    Re: Alternative for my extremely slow code?

    Hi Warmerfare,
    Probably I'd go rather into arrays than into dictionaries, but before start, I've got one suggestion and one request:
    - consider posting the attachment with sample data (of course not 30k rows)
    - follow forum rules, namely Rule 3 of our Forum RULES. Use code tags around code.
    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Best Regards,

    Kaper

+ 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. Extremely Slow code. Please Help
    By flyersguy4 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-30-2011, 09:26 PM
  2. Extremely slow macro!
    By PSm1th29 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2010, 06:27 AM
  3. FileCopy extremely slow
    By Idiot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2008, 12:10 AM
  4. Excel is extremely slow now
    By Martindelica in forum Excel General
    Replies: 0
    Last Post: 05-01-2007, 08:32 PM
  5. Extremely slow file
    By Jay in forum Excel General
    Replies: 3
    Last Post: 07-10-2006, 08:19 AM
  6. EXTREMELY slow toolbars?
    By Maury Markowitz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-23-2006, 11:20 AM
  7. Excel vba script extremely slow
    By persenena in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2005, 08:05 AM
  8. Workbook is now Extremely Slow
    By Dmorri254 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-03-2005, 02:19 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