+ Reply to Thread
Results 1 to 5 of 5

Remove duplicates from all columns.

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Remove duplicates from all columns.

    Hi all

    I have been looking around for a code to remove duplicates from multiple columns however none appear to do what I need.
    Even the Remove Duplicate from the data tab does not help me.

    What I have:
    There are several columns of numbers which are separated by a full stop.
    The number of column's will not be able to be predetermined.

    What I need:
    I need a vba code that will look at the entire sheet and remove any duplicated cells and leave only one of the cells (which was duplicated).
    Then To save space on the sheet, I would also like it to re-order the sheet from smallest to largest. (this would move cells to different columns if needed)

    attached is an example
    Attached Files Attached Files

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Remove duplicates from all columns.

    Maybe :

    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Remove duplicates from all columns.

    Thanks, looks great.

    Is it possible to adjust it slightly to conform with the following situation?

    Sheet1 is continuously updated with new numbers on a loop basis (until the last row on the sheet it filled)
    Once an entire column of numbers in generated, it is moved to sheet2 where another code (hopefully your one), sorts and removes duplicates.
    After this process is complete, the data then moves to sheet3 (in the next available row), where another code is run to order the data from smallest to largest.

    I hope to be able to insert the duplication code in the middle of this entire process.

    Hope this makes sense

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Remove duplicates from all columns.

    You are welcome.

    Since you don't show your existing code, I can't help about it.

    But the idea will be like this :

    >>> Sheet1 is continuously updated with new numbers on a loop basis (until the last row on the sheet it filled)
    Your existing code should do this

    >>> Once an entire column of numbers in generated, it is moved to sheet2 where another code (hopefully your one), sorts and removes duplicates.
    Your existing code should do this (move data from Sheet1 to Sheet2)
    Then after your code has done the moving process, call my Sub.

    >>> After this process is complete, the data then moves to sheet3 (in the next available row)
    In my Sub, the output is place on range H1 around by this line of code :
    Please Login or Register  to view this content.
    Your code should locate next available cell on Sheet3 (let say its name is TargetCell), then change the code above to this :
    Please Login or Register  to view this content.
    >>> where another code is run to order the data from smallest to largest.
    Your existing code should do this.

  5. #5
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Remove duplicates from all columns.

    Hi again

    Is it possible to change the following code, so it will paste the result by using all of a column before putting the results in the next available Col or cell?

    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)

Similar Threads

  1. Remove duplicates across multiple columns
    By moishier in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2016, 12:17 PM
  2. Dynamacially remove duplicates from two columns into a third
    By spoursy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-11-2014, 10:58 AM
  3. Remove Duplicates in columns
    By naveenmarapaka in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-31-2014, 11:10 AM
  4. Compare 2 columns and remove duplicates in both columns when found
    By 1dtms in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-11-2013, 02:19 AM
  5. Replies: 1
    Last Post: 04-17-2008, 03:15 PM
  6. how do i compare two columns and remove duplicates?
    By aljernon805 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-09-2005, 12:10 PM
  7. [SOLVED] compare two columns and remove duplicates
    By Moni39 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-05-2005, 02:06 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