Looping through workbooks and copy pasting data between dates

  • Hi guys , need some help with vba.

    i am looping through workbooks and copy pasting the data in my macro sheet, then i delete the columns which do not fall in between dates(dates from data sheet in macro file). i am attaching the files, the vba works but if the data is big then it takes too long to complete. i am using copy pasting alot. please advise(novice in vba, just starting), any way i can use some other method , i tried setting range equal to range method but i got an error.

  • Hello,


    The big challenge for large workbooks is to cope with the core structure which was picked at the very beginning ...

    Indeed, the various consequences of a bad structure do lead to many obstacles, such as difficulties and obstacles to handle data.

    Quite often, processing data does become very slow, and the crucial step of Analysis tends to be very cumbersome.


    To be effective, designing Excel spreadsheets should stick to following 7 Golden Rules:   7 Golden Rules for Spreadsheet Design


    Another link extremely well built by Dave to help designing Excel spreadsheets : Dave's unvaluable recommendations


    As a consequence of improper design, users tend to continue adding "patches" ... to avoid investing the time and effort to rebuild everything from scratch.


    When it comes to several large workbooks, one should consider working with flat files to replicate databases, and operate much more efficiently and rapidly with closed files, using, for example, techniques such as ADO. see link below:


    Import data from a closed workbook (ADO) using VBA in Microsoft Excel


    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

    Edited 2 times, last by Carim ().

  • You are welcome ;)


    Very sorry for the bad news ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Hi again,


    Among the "patches" to improve the speed of your macros, there is the following usual recommendation :


    Code
     ' At the very beginning of your macro
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    '
    ' Your Macro as it is currently ...
    '
    ' At the very end of your macro
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True

    Hope this will bring some improvement :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

    Edited once, last by Carim ().

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!