+ Reply to Thread
Results 1 to 6 of 6

Delete Row where duplicate value in A column but leave first number

  1. #1
    Forum Contributor
    Join Date
    09-19-2003
    Posts
    226

    Delete Row where duplicate value in A column but leave first number

    Hi

    I've got a worksheet that I need to delete entire rows where in column A there are duplicate values. BUT, must leave the line with the first value in place. So, if there are duplicate values in A3,A4,A5,A6 we need to keep row 3 and delete rows 4 to 6. There may be duplicate values further down the column that I need to do exactly as explained before.

    Thanks

    Patish
    Patish

  2. #2
    Registered User
    Join Date
    08-26-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    26

    Re: Delete Row where duplicate value in A column but leave first number

    Hi, does this work? (assuming data is in columns a-j and rows 1-22) can be edited to increase range

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-19-2003
    Posts
    226

    Re: Delete Row where duplicate value in A column but leave first number

    Thanks, trenzalore for your quick response.

    Three questions:

    - If I need to change the column of the duplicate items from A to E, let's say, what do I change in the code: A:A to E:E, yes. Change Columns:=1 to Columns:=5?
    - Does this apply to text duplicates as well?
    - I need the range of the active sheet to apply to the entire worksheet. Should I change the range to ("$A$1:$IV$65536")?

    Thanks

    Patish

  4. #4
    Registered User
    Join Date
    08-26-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    26

    Re: Delete Row where duplicate value in A column but leave first number

    Hi Patish,

    1) If you wanted to check for duplicates in another column (such as E) you would only change Columns =1 Columns:=5. The rest of the code can all stay the same


    2) yes it doesn't matter if the value in the cell is a Number or a text, if it finds a duplicate value in the column it will delete the whole row

    3) yes if you need to change it to that big a range should work but I if you are not using the entire worksheet try to select only what you need as I think it could make it slow

    good luck!

  5. #5
    Registered User
    Join Date
    08-26-2016
    Location
    London
    MS-Off Ver
    2010
    Posts
    26

    Re: Delete Row where duplicate value in A column but leave first number

    Hi Patish,

    1) Yes that's right, if you wanted to check for duplicates in another column (such as E) you would only change Columns =1 Columns:=5. The rest of the code can all stay the same


    2) yes it doesn't matter if the value in the cell is a Number or a text, if it finds a duplicate value in the column it will delete the entire row

    3) yes if you need to change it to that big a range it should work I if you are not using the entire worksheet try to select only what you need as I think it could make it slow

    good luck!

  6. #6
    Forum Contributor
    Join Date
    09-19-2003
    Posts
    226

    Re: Delete Row where duplicate value in A column but leave first number

    Many thanks, Trensalore. I'll check it out and be back.

    Patish

+ 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. Replies: 8
    Last Post: 06-25-2015, 08:59 AM
  2. [SOLVED] How to remove duplicate data but leave the row with highest value from another column
    By mgilmore77 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-22-2014, 08:59 PM
  3. [SOLVED] Delete Row if There is a Duplicate Number in same Column
    By PaulLor89 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-14-2014, 01:52 PM
  4. [SOLVED] Sum columns (duplicates in row header) & delete duplicate cols to leave single unique cols
    By kinrossfarm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2014, 05:50 AM
  5. [SOLVED] delete duplicate in one column, but leave cells blank
    By odieses in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 07-02-2013, 03:32 PM
  6. Replies: 4
    Last Post: 09-18-2012, 09:06 AM
  7. Delete Duplicate column's row
    By prayami in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2011, 10:35 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