+ Reply to Thread
Results 1 to 4 of 4

Macro to search for duplicates

  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    USA
    MS-Off Ver
    2007
    Posts
    101

    Macro to search for duplicates

    Is it possible to use a macro to first highlight the duplicates in a column and then second to use the find and replace function to skip down the column to find each one. The duplicates will be UPC codes in a single column that will be "numbers stored as text". I would like the macro to search all of the column (Column Q for example), then highlight and find each duplicate.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Macro to search for duplicates

    What do you want the macro to do when it has found the duplicates?

    A simple way of highlighting duplicates in Excel 2007 is to use conditional formatting - see the options under 'New rules'
    Martin

  3. #3
    Forum Contributor
    Join Date
    01-13-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2003, 2007
    Posts
    168

    Re: Macro to search for duplicates

    You can also use VBA Macro to do the same,

    The following macro will search for duplicate entries and except for the original (will be chosen based on the position) this macro will colour all the entries that matches the original..
    Please Login or Register  to view this content.
    Instead refer to the attached file where on running the macro all the unique entries are displayed.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-21-2009
    Location
    USA
    MS-Off Ver
    2007
    Posts
    101

    Re: Macro to search for duplicates

    Ok, let me try to explain it a little differently. I used the Conditional Formatting function to find all duplicate values in column Q. That works fine. Next I try to go to the first duplicate value by using the Find and Replace. That is where it does NOT work. Finally, I would like to wrap this all up and place it into a macro. So that the macro would prompt me to continue after finding each duplicate. (See image below for example)
    Attached Images Attached Images

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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