+ Reply to Thread
Results 1 to 14 of 14

Combining multiple tables into one without changing the data

  1. #1
    Registered User
    Join Date
    10-03-2019
    Location
    Waterloo, ON
    MS-Off Ver
    2013
    Posts
    11

    Combining multiple tables into one without changing the data

    Hi Everyone,

    I was wondering if anyone can help guide me in the right direction, I think this should be easy but for the life of me I can't figure it out.

    I have a workbook full of sheets that have identical tables in them, each sheet for a different project. Each project uses different chemicals and they all have different expiry dates. What I would like to do is see all of the expiry dates in one big list so I don't have to go to each sheet separately to see when my standards are going to expire, I would like it all listed in one sheet that I can sort as I please. Here is a snip of the type of table that I am talking about, I just need the first 5 columns.

    Attachment 643896
    Capture.JPG

    So I basically just need to take col A to E all rows with something in them minus the top header and append them into one big table and have the ability to update this table either when loading the excel workbook or clicking a macro button (There are 32 tables in total so I would rather use something optional so it doesn't take long to load the book when you're just updating something)

    99% of the Standards in all of the sheets are named differently however there are a few that are the same, I do not want these merged but listed separately.

    I have Excel 2013 at work so can't change the version but I can install add-ons (from MS only).

    Thank you for any help

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Combining multiple tables into one without changing the data

    .
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-03-2019
    Location
    Waterloo, ON
    MS-Off Ver
    2013
    Posts
    11

    Re: Combining multiple tables into one without changing the data

    Hi Logit, thank you for your reply and sorry for my late response I finally got time today at work to try out your code and it worked great thanks. I attached the macro to a button and I was wondering if there is a string that we can add that will clear the sheet of the previous search before it populates for the current search?

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Combining multiple tables into one without changing the data

    .
    Interesting turn of events here .... the previous macro I posted wouldn't work again. Hmmm ....

    So with a few edits, it is working again. Not certain what happened ???

    Please Login or Register  to view this content.

    (Later edit) Duh ! Dummy me ... my grey matter is not working again. The first macro provided did not utilize the OPTION EXPLICIT statement at the top of the macro. That is why is ran well the previous times.
    And of course this time I am using OPTION EXPLICIT
    Last edited by Logit; 10-07-2019 at 04:22 PM.

  5. #5
    Registered User
    Join Date
    10-03-2019
    Location
    Waterloo, ON
    MS-Off Ver
    2013
    Posts
    11

    Re: Combining multiple tables into one without changing the data

    Ahh thank you so much, you have made my job a ton easier and I learned a lot. I forgot to mention to clear contents but keep the header row so I changed the code a little to this WS1.Cells.Rows("2:" & Rows.Count).ClearContents - not sure if that is the right way to do it but it works lol

    Again thank you so much, I really appreciate you taking the time to help a noob out.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Combining multiple tables into one without changing the data

    .
    You got it ! Glad this will make your job easier.

    Happy to help.

    Cheers !
    Last edited by Logit; 10-18-2019 at 11:06 AM.

  7. #7
    Registered User
    Join Date
    10-03-2019
    Location
    Waterloo, ON
    MS-Off Ver
    2013
    Posts
    11

    Re: Combining multiple tables into one without changing the data

    Hi, me again

    I have been playing around with it for the past day or two and I almost have it exactly the way that we need it, just one more thing that I can't figure out I keep getting an error message when I try.

    Right now I am coping a2:f but I need to add H in there as well, skipping G. Would you be able to help me out with that?

    Thanks a lot!

    Quote Originally Posted by Logit View Post
    .
    You got ! Glad this will make your job easier.

    Happy to help.

    Cheers !

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Combining multiple tables into one without changing the data

    .
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-03-2019
    Location
    Waterloo, ON
    MS-Off Ver
    2013
    Posts
    11

    Re: Combining multiple tables into one without changing the data

    Thanks for your reply, however that code doesn't skip col G which I need to omit as it has check boxes in it that wont sort or clear with the macro.

    Quote Originally Posted by Logit View Post
    .
    Please Login or Register  to view this content.

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Combining multiple tables into one without changing the data

    .
    This is one method :

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-03-2019
    Location
    Waterloo, ON
    MS-Off Ver
    2013
    Posts
    11

    Re: Combining multiple tables into one without changing the data

    I tried something like that but it wont delete the check boxes that are in G and I need to keep the header row as well, this is what it gives me after it "deletes" col G

    Attachment 644787

  12. #12
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Combining multiple tables into one without changing the data

    .
    I couldn't view your attachment. The Forum Server says it is not a valid format.

    In any case ... see if this does it :

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    10-03-2019
    Location
    Waterloo, ON
    MS-Off Ver
    2013
    Posts
    11

    Re: Combining multiple tables into one without changing the data

    Ahhh I didn't think of just duplicating that line again, I kept trying to add code to the existing one. That worked perfectly thank you again

  14. #14
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: Combining multiple tables into one without changing the data

    .
    You are welcome.

    There are most likely a thousand and one ways to accomplish your goal. All are correct and none of them are wrong.
    Mine was just one.

    Glad to help.
    Last edited by Logit; 10-18-2019 at 11:07 AM.

+ 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. [SOLVED] Combining data from multiple tables
    By Mr. Z in forum Excel General
    Replies: 3
    Last Post: 06-11-2019, 02:35 AM
  2. Replies: 4
    Last Post: 07-25-2017, 03:49 PM
  3. Replies: 7
    Last Post: 05-19-2015, 01:21 AM
  4. Changing Source Data of Multiple Pivot Tables
    By mlegge04 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2012, 04:26 PM
  5. Excel 2010: Changing Source data on multiple pivot tables
    By dcoates in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-24-2012, 03:42 PM
  6. Replies: 1
    Last Post: 03-14-2012, 03:45 PM
  7. Combining Multiple Tables
    By fervorking in forum Access Tables & Databases
    Replies: 4
    Last Post: 06-24-2011, 10:44 AM

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