+ Reply to Thread
Results 1 to 12 of 12

Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    Huntsville, Alabama
    MS-Off Ver
    Excel 2007
    Posts
    29

    Question Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    ALCON,

    I have a macro that will allow me to copy the first worksheet in a list of Excel workbooks, to a new workbook and place all of the worksheets on a single worksheet in the new workbook. That one is fine and I do not wish to break it.

    However, I now have a different conundrum to overcome and that is the ability to copy all worksheets, in multiple workbooks, to a new workbook, but this time I want all worksheets copied to separate worksheets in the new workbook. Kind of like when you do it manually, and right click the tab, select 'Move or Copy', then choose which workbook you want them copied to. I want to automate that process down to pushing a button on a worksheet. I know there will be some looping involved, but trying to figure it out on my own without a VBA manual, makes it a little bit harder than usual.

    So, has anyone done anything like this before? If so, I would accept any and all useful advice on this subject.

    I'd like to thank everyone in advance for reading my post and for those who answer, my eternal gratitude.

    DBH ends......

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    It certainly can be done. But you will need to explain where the files will be kept? How many if they are not in the same folder location? What sheet or No. of sheets that need to be copied?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Registered User
    Join Date
    01-09-2012
    Location
    Huntsville, Alabama
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    All the files I will be copying from are in a single folder, and there can be up to 5 sheets per workbook. However, not all workbooks will have 5 worksheets, some will have only 1, some 2, etc. I was going to execute the macro from a file that is one level up from the folder where the data is contained. I was going to prompt (with Inputbox) the user to tell the macro where the files are, and use that entered string to find the files. All files in the folder will be .xlsx files (Excel 2007 format)

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    So you want all files in that folder and all sheets in each workbook? And you want to prompt the use to select the folder where you want to copy from?

  5. #5
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    Ok try this. When prompted, select the folder you want to save the files sheet from. It will create a new workbook with the copied sheets.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-09-2012
    Location
    Huntsville, Alabama
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets


    Outstanding, I cannot thank you enough because this is EXACTLY what I was looking for, and you did it a lot easier than I would have done it (newbie VBA programmer that I am).

    I wish there was something I could do to help you, and who knows, maybe someday in the future. Thanks again.

  7. #7
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    Glad I could help.

  8. #8
    Registered User
    Join Date
    08-23-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    I am trying to take multiple Excel workbooks and merge them into one for summary purposes. What code is best for this? I have tried several and failed. Please help?

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    Hello sbastin, and welcome to the forum.

    Unfortunately you have inadvertently broken one of the forum rules. Please read the following and make the necessary change. Thanks.

    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.

  10. #10
    Registered User
    Join Date
    08-27-2012
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    This is simply great solution. Can anyone guide me how to post my problem

  11. #11
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    Hello Abhi_1977, and welcome to the forum.

    Go to the main page and, from the list of sub-forums you see there, choose the one that is most appropriate for your problem. Once in the sub-forum you'll see a blue button labelled "+ Post New Thread" at the top left. Click on that to open a new window where you can type your problem. Make sure to give your thread an acceptable title that complies with rule #1. If you haven't read the rules yet you should click on the Forum Rules button at the top of the page before trying to post.

  12. #12
    Registered User
    Join Date
    08-27-2012
    Location
    Pune
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Copying Worksheets from Multiple Workbooks to a Single Workbook, Separate Worksheets

    Hello Cutter

    Thanks a lot. I have successfully posted my problem.

    Regards,

    Abhijit.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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