+ Reply to Thread
Results 1 to 8 of 8

Merging selected sheets with selected columns into another sheet

  1. #1
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Merging selected sheets with selected columns into another sheet

    Hi,
    Please help me with merging selected sheets with selected columns into another new sheet
    I have attached a example excel file which you can use for the merging purpose.
    Criteria:
    Only merge Sheet 3, 4 and 5
    and only take column A, C and D from each sheets
    and on the top of the new file should have header column name as mentioned in the sheets.
    Attached Files Attached Files

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

    Re: Merging selected sheets with selected columns into another 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
    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
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Merging selected sheets with selected columns into another sheet

    Hi, Arlette,

    if itīs a new worksheet why not copy the ranges from A to D at once (goes both for headers as for data range) and delete Column B from the new sheet at the end of the macro?

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

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

    Re: Merging selected sheets with selected columns into another sheet

    Yes, that can be done too. There are many ways of working this out. I just picked one.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Merging selected sheets with selected columns into another sheet

    This should do. Just create a sheet named "Master" which consolidate all three sheets

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Merging selected sheets with selected columns into another sheet

    Thanks a lot for your help, you all have been really helpful!

  7. #7
    Registered User
    Join Date
    02-17-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Merging selected sheets with selected columns into another sheet

    Quote Originally Posted by arlu1201 View Post
    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
    Thanks your this code was very helpful for me!!

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

    Re: Merging selected sheets with selected columns into another sheet

    Am glad it worked.

+ 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