+ Reply to Thread
Results 1 to 15 of 15

Combine all tables of the workbook into one but column headers are different

  1. #1
    Registered User
    Join Date
    09-12-2022
    Location
    Uk
    MS-Off Ver
    office 365
    Posts
    42

    Combine all tables of the workbook into one but column headers are different

    HI
    I want to combine all the sheets of a file into one in the same file. but my problem is column headers are not exactly same. I want to it be dynamic means If data changes or a new sheet is added It will reflect in the combined data.
    If some one changes the header it should still work.

    I have searched the internet but can not find answer to this. I am attaching the sample file here also

    I want to only combine the tables that have "batch" in the name

    is there a way I ca do it
    thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Combine all tables of the workbook into one but column headers are different

    And what should the final result look like (show us)?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    09-12-2022
    Location
    Uk
    MS-Off Ver
    office 365
    Posts
    42

    Re: Combine all tables of the workbook into one but column headers are different

    apologies I think I replied to you privately
    here is it should look like
    Attachment 859764

    if I can have cell colour formatting in the combined sheet that's Bonus

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Combine all tables of the workbook into one but column headers are different

    Option 1. A more complicated formula... taking about 5 seconds to add a new sheet manually.

    Option 2. Insert columns until ALL shhets start on the same column.... taking about 2 seconds to add another sheet manually.

    Take your pick.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-12-2022
    Location
    Uk
    MS-Off Ver
    office 365
    Posts
    42

    Re: Combine all tables of the workbook into one but column headers are different

    Hi Glenn
    thanks for this solution.
    but I can only sort this using formula and this sheet will be used by others also who do not know excel.
    is here any possibility I can do it using Power query

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Combine all tables of the workbook into one but column headers are different

    I don't know PQ. Others will help.

  7. #7
    Registered User
    Join Date
    09-12-2022
    Location
    Uk
    MS-Off Ver
    office 365
    Posts
    42

    Re: Combine all tables of the workbook into one but column headers are different

    thanks a lot Glenn for the your help.

    Can anyon with the knowledge with Power Query help me

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Combine all tables of the workbook into one but column headers are different

    I can't see the attachment to post #3, as it's invalid, so I don't really know what we're aiming for.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Combine all tables of the workbook into one but column headers are different

    Just seen this:

    If some one changes the header it should still work.
    PowerQuery is a non-starter with this level of potential inconsitencies in your header data. YOu might have to go with VBA.

  10. #10
    Registered User
    Join Date
    09-12-2022
    Location
    Uk
    MS-Off Ver
    office 365
    Posts
    42

    Re: Combine all tables of the workbook into one but column headers are different

    Actaully the attachment in Post 3 is only reply to Glenn question I am attaching it again here.
    Attachment 859847

    "If some one changes the header it should still work." this is extra if not possible/too difficult just ignore it

    Actaully i Need the first line of column header
    where column header starts "with Result unit......" i need only "Result Unit 501" "Result Unit 423" etc
    can I sort data without formulas using VBA? if yes Can you tell me how to do it with VBA.

    Thanks in Advance

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Combine all tables of the workbook into one but column headers are different

    Do you want me to move this to the VBA section?

  12. #12
    Registered User
    Join Date
    09-12-2022
    Location
    Uk
    MS-Off Ver
    office 365
    Posts
    42

    Re: Combine all tables of the workbook into one but column headers are different

    If moving the post is more helpful than posting a new question in VBA forum, then please move it.
    Thanks for al

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Combine all tables of the workbook into one but column headers are different

    What are the "header" changes? Can you provide an example?
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  14. #14
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Combine all tables of the workbook into one but column headers are different

    Quote Originally Posted by excelwala12 View Post
    "If some one changes the header it should still work."
    What exactly does that mean? Will all the tables have the same header changes, or will the headers be different in some tables? If the latter, what do you expect to happen?
    Rory

  15. #15
    Registered User
    Join Date
    09-12-2022
    Location
    Uk
    MS-Off Ver
    office 365
    Posts
    42

    Re: Combine all tables of the workbook into one but column headers are different

    it could be one or two or changed a header of column 2 in every table,
    but managing column header name change is difficult just ignore this. It is not a priority.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Combine three sheets with same column headers into separate sheet
    By KM20168 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-07-2021, 04:57 AM
  2. Replies: 13
    Last Post: 09-01-2020, 09:58 AM
  3. [SOLVED] Combine tables with same headers but different information
    By theblackrazor in forum Access Tables & Databases
    Replies: 1
    Last Post: 09-09-2019, 06:34 AM
  4. Combine results and list headers to one column
    By mlopez60120 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2018, 11:48 AM
  5. Replies: 0
    Last Post: 02-24-2016, 04:04 PM
  6. Combine Excel Sheets with a lookkup of Column Headers
    By kishoremcp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2016, 02:17 AM
  7. [SOLVED] Display and Combine Column Headers each time a condition is true in each row.
    By srutenber in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-16-2012, 04:00 PM

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