+ Reply to Thread
Results 1 to 5 of 5

How to speed up this code ( cosolidates data from multiple excel files)

  1. #1
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    How to speed up this code ( cosolidates data from multiple excel files)

    Hi all,

    I have consolidation workbook, which got below code.
    This consolidates data from multiple excel file to consolidation work book.

    The challenges are as follows,
    1) Code is collating data very slowly, for 40 files it takes around 5 minutes
    2) If the Number of files is more in the folder path, then the consolidation workbook force closes.

    I think code is not efficient enough.

    Could someone look into the code and feel free to edit it please.


    Please Login or Register  to view this content.
    Thank you

    If I have helped you in someway, use the * icon below to give reputation feedback, it is appreciated.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: How to speed up this code ( cosolidates data from multiple excel files)

    For a start, get rid of all the selects and activates.

    For example, this:

    Please Login or Register  to view this content.
    can be this:
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: How to speed up this code ( cosolidates data from multiple excel files)

    Hi,

    Without change above given piece of code runs in 01 min 16 seconds
    But with change you have proposed it runs in 01 min 38 seconds

    can you suggest, whatelse change i can do.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: How to speed up this code ( cosolidates data from multiple excel files)

    Please post sample workbooks ... one with the code and one or more data files.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to speed up this code ( cosolidates data from multiple excel files)

    I looked at your code and simplified it some, maybe this helps, it all depends on the ammount of data you are copying and pasting
    Please Login or Register  to view this content.
    Without sample files (dummy data) it's hard to tell
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

+ 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] Speed up code containing multiple nested loops
    By danielexcelvba in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2018, 02:26 AM
  2. VBA code to consolidate multiple excel files into one workbook.
    By krazyhype19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2014, 06:46 AM
  3. Speed up code that opens and pulls data from 30+ excel files and then closes file
    By chadwick140 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2013, 09:58 AM
  4. Replies: 0
    Last Post: 11-27-2012, 01:43 PM
  5. Code to pull data from multiple files?
    By WaveOfMutilation in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-17-2010, 07:25 PM
  6. Code to open multiple excel files
    By mmf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2008, 05:40 AM
  7. Speed up pivot table VBA code, avoid multiple recalculations
    By Ronny in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2005, 04:00 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