+ Reply to Thread
Results 1 to 18 of 18

Merge multiple worksheet to summary worksheet based on column header value match

  1. #1
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Merge multiple worksheet to summary worksheet based on column header value match

    Pls help with a macro to - Merge multiple excel files in a folder - to a new summary worksheet based on column header value match. The column in the excel file are not in same order. In the below example the Phone header is in Column c in Workbook1-sheet 1 whereas the Phone header is in Colum B in Workbook2-sheet 1

    Workbook1-sheet 1
    ColA ColB ColC
    Name Nickname Phone
    John Jo 9841

    Workbook2-sheet 1
    ColA ColB
    Name Phone
    Mathew 9840


    Result - new summary worksheet
    ColA ColB ColC
    Name Nickname Phone
    John Jo 9841
    Mathew empty 9840


    Thank you

  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: Merge multiple worksheet to summary worksheet based on column header value match

    Will the summary worksheet already be created with headers? OR should the macro create it?
    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
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    The Macro has to create the Summary worksheet with headers.

  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: Merge multiple worksheet to summary worksheet based on column header value match

    Does your sample data above match your original data with respect to the headers? The reason i am asking you is - sometimes the users post a sample data / file with just 3 headers but the original file has 10 headers. They find it difficult to edit the macro to match the original file and sometimes the person answering the question has to even redo the whole code.

  5. #5
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    The exact header value's are given below.
    I found one more issue while copying the exact header name. There are two columns headers(Ft/Pt) with the same name. Is it possible to treat it as two separate columns only for the value (Ft/Pt).

    S.No
    Date
    Phonenumber
    Surname
    Husband's name
    Wife Name
    Age
    Occupation
    Ft/Pt
    Partner's Occupation
    Ft/Pt
    Income
    Home Status
    Prop Value
    Mortage
    No of IP
    IP Value
    No of years own IP
    Address
    Suburb
    Post code
    State
    Survey Comments

  6. #6
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    Missed the below two headers in other excel file

    DISPOSITION
    Mobile number

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

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    I found one more issue while copying the exact header name. There are two columns headers(Ft/Pt) with the same name. Is it possible to treat it as two separate columns only for the value (Ft/Pt).
    But if you need to search for the header, these fields can create confusion. How will the macro know which column to copy the data into?

  8. #8
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    The two columns Ft/Pt are always after Occupation and Partner's Occupation. Will this condition work?

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

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    Ok, we will need to put in some additional conditions for this but can be done.

  10. #10
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    Any Idea on how to merge excel files based on column header value match?
    Can anyone point me to a pointer where I can start merging based on column header value match.

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

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    Quote Originally Posted by rafiomeon View Post
    Missed the below two headers in other excel file

    DISPOSITION
    Mobile number
    Are these 2 headers a part of your summary file?

  12. #12
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    Yes DISPOSITION and Mobile number are part of the summary file.

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

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    Is it possible for you to attach 1 or 2 sample files showing how the data appears in the file?

    Is there any column in all files that will always have data? I will need to use it to find the last row of each file.

  14. #14
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    Attached 2 sample files.

    Columns will either have data or it will be empty.
    Attached Files Attached Files

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

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    So you can have either .xlsx or .xls files in your folder?

  16. #16
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    yes and even csv format

  17. #17
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    Can anyone guide me to merge excel files based on column header value match. Need to merge multiple excel files based on column header.
    Has anyone done this already?

  18. #18
    Registered User
    Join Date
    11-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Merge multiple worksheet to summary worksheet based on column header value match

    I found a code and modified according to the below requirement - Merge multiple excel files in a folder - to a new summary worksheet. The Macro has to create the Summary worksheet with headers.

    Workbook1-sheet 1
    ColA ColB ColC
    Name Nickname Phone
    John Jo 9841

    Workbook2-sheet 1
    ColA ColB
    Name Phone
    Mathew 9840


    Result - new summary worksheet
    ColA ColB ColC
    Name Nickname Phone
    John Jo 9841
    Mathew empty 9840

    Requirement:
    Pls help to update the below code for the below features

    Want to update the summary sheet column 2 if the excel file column heading is "S.No"
    Want to update the summary sheet column 3 if the excel file column heading is "Date"

    Can you pls guide me to update the code


    Please Login or Register  to view this content.

+ 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