+ Reply to Thread
Results 1 to 27 of 27

Combine data from multiple sheets and remove duplicates if any

  1. #1
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Combine data from multiple sheets and remove duplicates if any

    I have data in multiple worksheets in specific columns.I want all of them to be in a two columns with no duplicates.Sample data and expected results are shown in Worksheet'Expected Result' in column A and B.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Combine data from multiple sheets and remove duplicates if any

    How about (Run "jec"):

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Combine data from multiple sheets and remove duplicates if any

    Please Login or Register  to view this content.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Combine data from multiple sheets and remove duplicates if any

    Hi. My ver

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2507 Win 11
    Posts
    24,918

    Re: Combine data from multiple sheets and remove duplicates if any

    An alternative to VBA is Power Query

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Post# 3 & 4 doesn't seems to work as per expected results in Post#1.
    Last edited by paradise2sr; 08-15-2022 at 11:53 PM.

  7. #7
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Quote Originally Posted by JEC. View Post
    How about (Run "jec"):

    Please Login or Register  to view this content.
    Kindly add sheet name in code (As I will be combining specific sheet name and not all) with sorted alphabetically.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Combine data from multiple sheets and remove duplicates if any

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Thanx @JEC & @jindongot the results as expected. Post #1 remaining part adding specific sheet name & sorting alphabetically was accomplished perfectly by Jindon.

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Combine data from multiple sheets and remove duplicates if any

    Post# 3 & 4 doesn't seems to work as per expected results in Post#1
    Please explain for #3 where you get the differance with the expected results.

  11. #11
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Kindly enclosed the workbook with your code.My Last version of office is 2021.

  12. #12
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Combine data from multiple sheets and remove duplicates if any

    Here my solution, including the sorting and predefined sheetnames.

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Thanx JEC.

  14. #14
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Combine data from multiple sheets and remove duplicates if any

    You're welcome!

  15. #15
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,505

    Re: Combine data from multiple sheets and remove duplicates if any

    And one with power query

    Please Login or Register  to view this content.
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Combine data from multiple sheets and remove duplicates if any

    @paradise2sr

    Kindly enclosed the workbook with your code.My Last version of office is 2021.

    If you are responding out of sequence, it is usually enough just to mention the helper's user name (e.g @Oeldere).


    "Post# 3 & 4 doesn't seems to work as per expected results in Post#1
    Please explain for #3 where you get the differance with the expected results."

    Since you test the code, you can also give the reason what the differance is with the expected result.

    I expect no differance, so I ask you to show it.

  17. #17
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Pls find enclosed in attachment.There is #Value Error in Column B in Consolidated Sheet on running code as per your Post #3.This was the main reason,why it did not worked in my version of excel.


    Value error.png
    Attached Files Attached Files

  18. #18
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Combine data from multiple sheets and remove duplicates if any

    See my red text in the code.

    "'it adds an @ before the formula and that result in "value"
    'I remove the @ manualy from the formula and copied the date down.
    "


    See the attached file.

  19. #19
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Oh,Now I got it.Thanx for the clearing the confusion.

  20. #20
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Combine data from multiple sheets and remove duplicates if any

    @paradise2sr

    Thanks for the reply.

  21. #21
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Hi@Jindon,

    Refer to your Post #8 code,I found some data not mentioned above in Post #1 (enclosed in attachment) instead of extracting number is extracting whole text.

    I have highlighted the with Red color.

    Hence,I hope you can revised your code accordingly. Others things are fine.

  22. #22
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Combine data from multiple sheets and remove duplicates if any

    Please Login or Register  to view this content.

  23. #23
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Worked well but one of my data earlier was resulted in correct way but now resulted wrong using this code.Kindly see what is missing.
    Attached Files Attached Files

  24. #24
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Combine data from multiple sheets and remove duplicates if any

    Is this the last one?

    Don't ask one by one.

  25. #25
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Yes,it's last one.I have tested in all my private file with large data.

  26. #26
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Combine data from multiple sheets and remove duplicates if any

    Add one line in bold
    Please Login or Register  to view this content.

  27. #27
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2024
    Posts
    1,390

    Re: Combine data from multiple sheets and remove duplicates if any

    Perfectly worked with no issue.Thanx

    Please Login or Register  to view this content.
    Last edited by paradise2sr; 08-21-2022 at 09:27 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. Combine data through different worksheets and remove duplicates
    By Haree in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2020, 10:27 AM
  2. Replies: 6
    Last Post: 10-19-2018, 02:44 PM
  3. Need to combine data from two different sheets and avoid duplicates
    By samratpahwa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-17-2018, 11:48 PM
  4. Replies: 1
    Last Post: 05-03-2018, 05:18 PM
  5. Select Data from Multiple Sheets, Save on one - Remove Duplicates
    By snuffnchess in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2018, 11:35 AM
  6. Need a macro to Compare multiple sheets and Remove Duplicates
    By ajaypal.sp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-03-2015, 12:18 PM
  7. Replies: 2
    Last Post: 01-13-2014, 10:52 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