+ Reply to Thread
Results 1 to 10 of 10

Copy Data from multiple workbooks to master workbook

  1. #1
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Copy Data from multiple workbooks to master workbook

    Hi

    I have more than 10 similar workbooks (District 1, District 2, District 3... District 20) saved in a folder, named District Sales, on the desktop.

    These workbooks are for sales in the various districts.

    I have another workbook, Master Sales, in this folder.

    Please assist me with the vba for:
    1) Copy the data from the various workbooks to this Master Sales workbook
    2) Sort the copied data according to Date, ie Column A

    Thank you for the assistance.

    Regards
    Nancy
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Copy Data from multiple workbooks to master workbook

    Place this macro in a regular module in the Master workbook and save the file as a macro-enabled file so its extension changes to "xlsm". Do this before you run the macro. Once saved, run the macro.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Copy Data from multiple workbooks to master workbook

    Hi

    The codes are exactly what I need and wonders. However, there is an extra "title" line at the last row.

    Attached updated workbook for your kind assistance.

    Thank you.

    Regards
    Nancy
    Attached Files Attached Files

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Copy Data from multiple workbooks to master workbook

    Try the attached file. I tested it using the four District files you posted and I didn't get an extra "title" line at the last row.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Copy Data from multiple workbooks to master workbook

    Hi

    The error is "runtime 438".

    Kindly advise the code to resolve this problem.

    More questions:
    1) How to run the macro?
    2) Only new entries/data be updated?

    Thank you & Regards

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Copy Data from multiple workbooks to master workbook

    Since the macro is working properly when I use the files you posted, I cannot determine what is causing the problem. The error is most likely caused because the actual files you are using are organized differently from those you posted. Are they different? When you get the error and when you click "Debug" which line of code is highlighted? What do you mean by "Only new entries/data be updated?"

  7. #7
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Copy Data from multiple workbooks to master workbook

    Hi

    Sorry for the misunderstanding.

    There is another file in Master Sales.xlsx file in the folder. The first set of code works wonders. Thank you for the great assistance.

    However, if I run the macro twice, the same data from the various workbook are updated or copied into this Master Sales Worksheet twice.

    Kindly help with only copy new data from the various workbooks into this Master Sales Workbook.

    Thank you and regards.
    Last edited by nancyching1711; 04-24-2018 at 01:16 PM.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Copy Data from multiple workbooks to master workbook

    Try:
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    04-20-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    135

    Re: Copy Data from multiple workbooks to master workbook

    Hi

    Thank you for the solution.

    Your assistance has lightened my work greatly.

    Thank you & Regards
    nancy

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Copy Data from multiple workbooks to master workbook

    My pleasure.

+ 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. Copy data from multiple workbooks into one master workbook
    By hellohello1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2014, 04:28 AM
  2. Copy data from multiple workbooks to one master workbook
    By kevinvanberkel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2014, 12:26 PM
  3. Copy Data from multiple workbooks to a master Workbook
    By zeeez in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-04-2012, 01:45 PM
  4. Copy data from multiple workbooks into consolidated/master workbook
    By mobro1234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2012, 02:42 PM
  5. Copy Data from Multiple Workbooks into Master Workbook Daily
    By gilbare in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2012, 05:45 PM
  6. Copy data from multiple workbooks to a single master workbook
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2012, 03:44 AM
  7. Replies: 5
    Last Post: 03-05-2012, 09:31 AM
  8. Replies: 24
    Last Post: 02-17-2012, 11:30 AM

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