+ Reply to Thread
Results 1 to 15 of 15

Adding contents of multiple files and putting them into one single file

  1. #1
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82

    Question Adding contents of multiple files and putting them into one single file

    I have 46 files with identical column headings and rows and I have to summarise the contents of each file into one file. Is there a way to merge these files automatically in one file? What I want is the data from the same cell addresses in each file to be added and put into the same cell addresses of a single new file. I have tried linking the files, but the number of rows and columns run into hundreds.

    Can this be done? I will appreciate any help.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523
    Quote Originally Posted by EsKay!
    I have 46 files with identical column headings and rows and I have to summarise the contents of each file into one file. Is there a way to merge these files automatically in one file? What I want is the data from the same cell addresses in each file to be added and put into the same cell addresses of a single new file. I have tried linking the files, but the number of rows and columns run into hundreds.

    Can this be done? I will appreciate any help.
    Hi,
    Here is a similar thread:
    http://www.excelforum.com/showthread.php?t=589590

  3. #3
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82
    Thank you.

    I am not an advanced Excel user, but will try to work my through what you have suggested.

  4. #4
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82
    Quote Originally Posted by davesexcel
    I will appreciate if you could answer the following questions:

    1. What does "InvoiceTest" in Workbooks("InvoiceTest") stand for? Is it the file name?

    2. What should I type in = Range ("M3") if the range in each of the worksheets is A1 to HC1150?

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523
    Quote Originally Posted by EsKay!
    I will appreciate if you could answer the following questions:

    1. What does "InvoiceTest" in Workbooks("InvoiceTest") stand for? Is it the file name?

    2. What should I type in = Range ("M3") if the range in each of the worksheets is A1 to HC1150?
    Please place this code in a workbook "InvoiceTest"(for this example)that is not in the folder to extract the info,
    This example searches a folder called C:\Invoices\ you will have to change it for the folder you require.
    Check to make sure the sheet names are correct as well...
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82
    Thanks. I have made the changes and tried to run the Macro, but it does not return anything in the file InvoiceTest.xls. I do not get any error messages either. So I presume the Macro does run but there is something else that I am doing wrong. The InvoiceTest file is saved in G: Drive and the data files are in H: drive.

    This is what I have done:

    Please Login or Register  to view this content.
    Last edited by davesexcel; 04-10-2008 at 10:30 PM.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523
    Range("A1:HC1150").Copy

    Do you actually have data in Column A?

    In plain English....

    What this code does is,
    Opens a workbook in the folder, copies A1:HC1150
    Then it goes to Workbooks("InvoiceTest").Sheets("Sheet1"), finds the last entry in column A moves down 1 row and pastes what has been copied, it then closes the workbook, and opens the next workbook,

    if there is no data in column A, you will always be pasting to the same spot, is this the case?
    Last edited by davesexcel; 04-10-2008 at 11:00 PM.

  8. #8
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82
    Thanks. Column A has "Heading" and the "Details" (Revenue, COS, etc.). The actual numbers against the details, which are to be added start from Column C.

    ColumnA ColumnC ColumnD


    Revenue $$$ $$$
    COS $$$ $$$


    and so on


    Also Between, A1 and HC1150, there are many blank cells intermittantly.
    Last edited by EsKay!; 04-10-2008 at 11:26 PM.

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523
    Quote Originally Posted by EsKay!
    Thanks. Column A has "Heading" and the "Details" (Revenue, COS, etc.). The actual numbers against the details, which are to be added start from Column C.

    ColumnA ColumnB ColumnC


    Revenue $$$ $$$
    COS $$$ $$$


    and so on
    Hi EsKay,

    So do you want to copy c1:HC1150 then? and paste to column C?
    Last edited by davesexcel; 04-10-2008 at 11:28 PM.

  10. #10
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82
    Quote Originally Posted by davesexcel
    Hi EsKay,

    So do you want to copy c1:HC1150 then? and paste to column C?

    Hi,

    I want to take the numbers in C5 from all the 46 files, add them and put the result into column C5 of InvoiceTest.xls. Similarly D5, E5 and so on upto HC1150. There are many empty cells in between where there is no data.

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523
    Hi,
    I have never used consolidate before, and have only tested it out on a single workbook, hopefully somebody else knows the answer better about it or even if it is possible,
    Check out help with excel consolidate, to get to it go to ,data,consolidate, lots of info on it as well on the web

  12. #12
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82
    Quote Originally Posted by davesexcel
    Hi,
    I have never used consolidate before, and have only tested it out on a single workbook, hopefully somebody else knows the answer better about it or even if it is possible,
    Check out help with excel consolidate, to get to it go to ,data,consolidate, lots of info on it as well on the web
    Thanks for your help so far. I am wondering what does the Macro that you have suggested do? It seems to run but nothing happens.

  13. #13
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523
    Quote Originally Posted by EsKay!
    Thanks for your help so far. I am wondering what does the Macro that you have suggested do? It seems to run but nothing happens.
    See post #7 for that answer,
    Did you check out consolidate?

  14. #14
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82
    Thanks. I am working through the Consolidate function. It does not seem to work the way I want it, but am still working on it.

  15. #15
    Registered User
    Join Date
    02-13-2008
    MS-Off Ver
    2007
    Posts
    82
    Quote Originally Posted by davesexcel
    See post #7 for that answer,
    Did you check out consolidate?

    Consolidate function does work, but does not automatically update the total in the destination file if the numbers in any of the 46 source files change. Is there any solution to this problem?

+ 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