+ Reply to Thread
Results 1 to 7 of 7

Delete Duplicates in Column D

  1. #1
    Registered User
    Join Date
    08-19-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    77

    Delete Duplicates in Column D

    Hello,

    I need help with a second portion of a macro. The first was answered by watersev in a previous post. I'm trying to create a macro that will Delete Rows of Duplicates found in Column D. It will start with the first row it finds that is yellow and check to see if that Column D matches any other yellow Column D's. If it does then the row the match is in gets deleted. Right now it searches in between the yellow rows, but for this portion I'm looking for it to use the yellow rows only. I included a file that has the examples on sheet1 and the expected outcome on sheet2. Any help is appreciated and thanks again.

    TestName.xlsm

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Delete Duplicates in Column D

    Try this code to see if this works as per your requirement.
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Registered User
    Join Date
    08-19-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: Delete Duplicates in Column D

    That works. Thank you.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Delete Duplicates in Column D

    You're welcome. Thanks for the feedback and rep.

  5. #5
    Registered User
    Join Date
    08-19-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: Delete Duplicates in Column D

    Sorry Sktneer, I got a little ahead of myself. It worked for the most part in the demo but when I tried it in the actual program I need it for it didn't work entirely. I included the same information from the top to the bottom of the testpage. What I'm trying to accomplish is for the macro to search for a yellow field in Column D. Once it finds a yellow field it will make that the primary key and check all other Yellow cells in Column D for a potential match(avoiding the cells that have no color value). If it finds a match it will Delete that row that corresponds to the match. Once its done searching for potential matches the macro will then go down Column D looking for another Yellow Field to make it the primary. I'm running this thru 60k files which is why I need it to keep switching primary key's and checking for duplicates. Right now it makes the top row the primary and finds the matches that corresponds to that value only.

    TestName.xlsm

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Delete Duplicates in Column D

    Try this code to see if this works.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-19-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: Delete Duplicates in Column D

    Almost, The only problem is that not everything in Column D is named Yellow. Like on the sample Sheet I have Blue in the columns as well. So that Duplicate should be caught. But these two values are not even in my regular data. In the regular data its a bunch of random numbers and letters which is why I need the program to search for itself thru the 60 files. Again I do appreciate the help.

+ 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] Delete Duplicates in Column D only
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-03-2014, 03:04 PM
  2. Replies: 8
    Last Post: 08-08-2013, 08:45 AM
  3. [SOLVED] Find duplicates in column A, add values from column B (possibly delete duplicates)
    By luarwhite in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-12-2013, 04:34 PM
  4. [SOLVED] Find duplicates, concatenate into different column, sum and delete duplicates
    By rosannang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2013, 11:23 AM
  5. [SOLVED] Macro to count unique values in a column, enter it in next column, then delete duplicates
    By pmorisse in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2013, 03:27 PM

Tags for this Thread

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