+ Reply to Thread
Results 1 to 3 of 3

Duplicating/Deleting rows based on criteria

  1. #1
    Forum Contributor
    Join Date
    02-21-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    100

    Duplicating/Deleting rows based on criteria

    tiz6mo3bph6kjhdrppfz.jpg

    Hey there!

    Please open the image, and then read my explanation below.

    Each row has a certain ID and 2 other values..the IDs are repeated on purpose.

    1) For each ID, there has to be only one row where Column 2 and Column 3 have the same value (so in this case ID 1, Row 2 satisfies this). - On the other hand, for ID 6, we'd have to add a new row (which Ive highlighted in green, Row 10).

    2) For each ID, there cant be duplicate rows. i.e. For ID 2, we should delete Row 5 as it's a duplicate of Row 4.

    I need VBA code to carry out the above 2 operations on a set of data..(there are actually way more than just 3 columns, Ive just shown 3 for this purpose)

    Hope I've explained myself well. If you have any questions do let me know.

    Thank you!

  2. #2
    Forum Contributor
    Join Date
    02-21-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    100

    Re: Duplicating/Deleting rows based on criteria

    Any ideas guys? Or perhaps some initial ideas?

  3. #3
    Registered User
    Join Date
    07-26-2013
    Location
    Oslo
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Duplicating/Deleting rows based on criteria

    Hi,

    What if you write a code where you:
    1: add a fouth column and make the formula =A2&b2&c2.
    2:remove duplicated values in this (4)column.
    3.remove column 4.

+ 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. Deleting duplicating rows
    By sampahmel in forum Excel General
    Replies: 1
    Last Post: 01-14-2013, 10:19 AM
  2. Deleting rows based on criteria
    By mcmuney in forum Excel General
    Replies: 6
    Last Post: 06-13-2011, 03:31 PM
  3. VBA for deleting rows not based on criteria
    By reggie1000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2009, 10:20 AM
  4. deleting rows based on criteria
    By scubadude47 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-14-2008, 01:53 PM
  5. Deleting rows based on criteria
    By MJK in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-16-2008, 08:45 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