+ Reply to Thread
Results 1 to 5 of 5

Copying data from multiple files into new one file.

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    Polska
    MS-Off Ver
    Excel 2010
    Posts
    3

    Copying data from multiple files into new one file.

    Dear All,

    I would need a help in creating macro which enables me to copy data from sheets of 3 files and paste them one below another in new file in one sheet.
    All three sheets have the same column order from A till AA but the rows are variable and are changing on a monthly basis.
    Summarizing, let's say my files are called 1,2,3 and the sheets are also called 1,2,3. They need to be copied to new file called 4 to one sheet called 4.
    Truly apprecaite your support.

    Best Regards,
    Asia

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Copying data from multiple files into new one file.

    Hello Algus,

    welcome to the Forum!

    This macro will open the workbooks you specify and copy them into a new workbook.

    The workbooks are assumed to located in the same folder and contain only a single sheet. You will need to change the workbook names (with extensions) and the path for your computer.

    Copy and paste this code into a new VBA Module in your workbook. You can run the macro manually using the Macro Dialog. To call the dialog, press the keys ALT+F8.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-27-2013
    Location
    Polska
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Copying data from multiple files into new one file.

    Dear Leith,

    Thanks a lot for reply. Since I am a totally new with VBA I came across some errors.
    When I am running the macro it is saying "Object doesn't support this property or method" and the following code is marked in yellow :Set DstRng = DstWkb.Range("A1").
    Apart from that I've forgotten to mention that the files with data to be copied will contain lots of sheets but the data should be taken only from one of them.
    Also it would be useful to have them copied as a value, no formulas.
    BTW ... are you able to recommend me some VBA trainings for dummies : ) just to have a basis and to learn by using ready codes.
    Thanks a lot!
    Algus

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Copying data from multiple files into new one file.

    Hello Algus,

    I will check on the cause of the error and get that corrected.

    Is the name of the sheet the same in each workbook?

    At the the top of the first page of the Forum is a "sticky" post that has information about books and other learning resources for VBA. Try that first. the forum members have made a lot of contributions to the post.

  5. #5
    Registered User
    Join Date
    06-27-2013
    Location
    Polska
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Copying data from multiple files into new one file.

    Yes, the names of the sheets are the same in each file.

    Best regards,

    Algus

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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