+ Reply to Thread
Results 1 to 10 of 10

Merge excel sheets from one file within one sheet

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    Lebanon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Merge excel sheets from one file within one sheet

    Hey,

    I have one question. Is it possible to merge all sheets in one but horizontally. The macro above merges all the sheets in one sheet vertically, data from the sheets are stacked under each other, I was wondering if I can have the data of each sheet stacked horizontally in one sheet.

    The idea is that column A of each sheet represents dates, and I want the data from the other columns of each sheets to be next to each other in the consolidated sheet.

    Hope you can help!

    Thanx,

    Rawan

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

    Re: Merge excel sheets from one file within one sheet

    Which code are you talking about? Are you referring to a thread ? You can post the link here.

    How about attaching a sample file or files so we can help you faster?

    To Attach a File:

    1. Click on Go Advanced.
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    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]

  3. #3
    Registered User
    Join Date
    07-16-2012
    Location
    Lebanon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merge excel sheets from one file within one sheet

    Sorry im new here and i didnt know how to attach a file. Im this is not a problem i copied and pasted the reply from one thread:

    Re: Merge worksheets into one within same workbook
    The key would need to be on each sheet, but 200!? How unmanageable that must be!

    No, with 200 sheets, I would abandon this and use an "on-demand macro" to assemble my "consolidated sheet". I wouldn't expect to be able to do this in realtime.

    Here's a macro that will do it for you:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    How to use the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet

    The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.

    NOTE: This will create a sheet called CONSOLIDATE, so you can delete your TEST sheet. It created the sheet off a 200sheet workbook in about 3 seconds.



    This code will merge my sheets vertially in one sheet howeer i want them to be mwrged horizontally, is that possible?

    Thank you!

    Rawan
    Last edited by arlu1201; 07-17-2012 at 04:37 AM. Reason: This post needed code tags.

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

    Re: Merge excel sheets from one file within one sheet

    In post 2, i have given you the steps needed to attach a file.

    So the sheets in the same file need to be consolidated into a master sheet in the same workbook, right?

    How many columns does your data have?

  5. #5
    Registered User
    Join Date
    07-16-2012
    Location
    Lebanon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merge excel sheets from one file within one sheet

    I have 300 sheets with 4 columns each. I want them merged into one master sheet horizontally, ie containing 300*4 columns ( the data merged next to eachother and not under each other).

    I have tried the steps in post 2 i didnt know how! Must have done something wrong!

    Hope you can help with mu merging problem.



    Thanks!

    Rawan

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

    Re: Merge excel sheets from one file within one sheet

    Are these 300 sheets in one workbook or in multiple workbooks?

  7. #7
    Registered User
    Join Date
    07-16-2012
    Location
    Lebanon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merge excel sheets from one file within one sheet

    Theyre all in one workbook

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

    Re: Merge excel sheets from one file within one sheet

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  9. #9
    Registered User
    Join Date
    07-16-2012
    Location
    Lebanon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merge excel sheets from one file within one sheet

    Thank you soo muchh it worked :D

    Cheers!

    Rawan

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

    Re: Merge excel sheets from one file within one sheet

    Am glad its working at your end.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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