+ Reply to Thread
Results 1 to 17 of 17

How to Copy Data from multiple workbooks to single workbook

  1. #1
    Registered User
    Join Date
    10-17-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    How to Copy Data from multiple workbooks to single workbook

    Hi

    I have a number of workbooks, which in turn has 12 worksheets each named as 12 months i.e. Jan, Feb, Mar, Apr etc.. Now i want to copy the data in these workbooks to a single master workbook, which has similar 12 worksheets. i.e. master workbook's Jan sheet should contain data of the slave workbooks' Jan sheet's data. Also it may be a possibility that the particular slave workbook does not have data in Jan, mar, apr, sep sheets, but have in all other sheets. The data format and pattern is exactly same in all workbooks and the master workbook.

    I hope i am able to explain the problem well... Plzzz help!!!
    Thanks in advance...

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to Copy Data from multiple workbooks to single workbook

    Is the data laid out exactly the same in each workbook and are the sheet names the same for each one?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    10-17-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to Copy Data from multiple workbooks to single workbook

    Yes.. All the sheets have similar data.. The sheet name is also same in all workbooks..

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How to Copy Data from multiple workbooks to single workbook

    Assuming the workbooks have been opened

    Please Login or Register  to view this content.
    NB. I think you could have found this solution many times using this forum's search function.
    Last edited by snb; 10-17-2010 at 04:30 AM.



  5. #5
    Registered User
    Join Date
    10-17-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to Copy Data from multiple workbooks to single workbook

    Can u explain it a bit?? I couldnt understand the code in order to modify it for my specifications..

  6. #6
    Registered User
    Join Date
    10-17-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to Copy Data from multiple workbooks to single workbook

    The data in the slave sheet doesn't start from the cell(1,1).and there is one more requirement,i want the slave sheet name in the master sheet sand then followed by the data... i.e.slave sheet name in column 1 and followed by data from column 2.. Plzzz help me out!!!!
    Last edited by Gautam Garg; 10-18-2010 at 03:00 AM.

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How to Copy Data from multiple workbooks to single workbook

    What don't you understand in my code and where did you look in the VBEditor's helpfiles ?

  8. #8
    Registered User
    Join Date
    10-17-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to Copy Data from multiple workbooks to single workbook

    I understood after going through help files..But i m still unable to modify it as i mentioned in earlier post that "data in the slave sheet doesn't start from the cell(1,1), it starts form (10,1) instead.

    and there is one more requirement, i want the slave sheet name in the master sheet sand then followed by the data... i.e.slave sheet name in column 1 and followed by data from column 2.."

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How to Copy Data from multiple workbooks to single workbook

    It doesn't matter where the data start in the code I suggested.
    That's why I used 'usedrange'.

  10. #10
    Registered User
    Join Date
    10-17-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to Copy Data from multiple workbooks to single workbook

    I mean to say is that the data to be copied starts from (10,1) earlier rows contain data, but that is nt to be copied..

  11. #11
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How to Copy Data from multiple workbooks to single workbook

    If you plunge into my code, assisted by the VBEditor's help (F1) you can easily modify the code to your wishes.

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to Copy Data from multiple workbooks to single workbook

    You need to attach an example workbook

  13. #13
    Registered User
    Join Date
    07-20-2012
    Location
    Portland, TN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to Copy Data from multiple workbooks to single workbook

    Snb,

    Could you modify your code so instead of copying the data to a single worksheet is copied into separate worksheets?

    Please Login or Register  to view this content.
    Thanks in advance

  14. #14
    Registered User
    Join Date
    06-22-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: How to Copy Data from multiple workbooks to single workbook

    Lupis, I just recently finished a similar project to yours. What I did was I imported the data to a single worksheet in one step, along with a note for what worksheet I wanted the information to end up in. Then in the second step, I copied the data into the proper destination sheets. Since this is all, of course, in VBA, the end user doesn't notice that it's being done in two separate phases.

    I'm also going to give you a piece of code that takes a cell reference, sheet name, file name, and file path, and it returns the value WITHOUT opening. Because while assuming that you're going to have something open is nice, I like this a lot better.

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    07-20-2012
    Location
    Portland, TN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to Copy Data from multiple workbooks to single workbook

    thanks Freakietiki34.
    The thing is that I am pulling files from SharePoint, opening each of them but not saving them because I don't need to save them. I just need to copy the data from "Sheet1" for each file and put the data on separate worksheets on another workbook.

  16. #16
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to Copy Data from multiple workbooks to single workbook

    lupitenis,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  17. #17
    Registered User
    Join Date
    07-20-2012
    Location
    Portland, TN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to Copy Data from multiple workbooks to single workbook

    I have submitted a new post.
    thanks

+ 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