+ Reply to Thread
Results 1 to 4 of 4

Deleting rows for duplicate data in few columns

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Deleting rows for duplicate data in few columns

    Hello folks,

    Hope you are doing good.

    I am working on an excel sheet having 40 odd columns. I need to Delete the rows if 4 of the columns have same data but keep the first row.

    Lets say I have below columns in excel
    Account No
    Account Name
    Trust
    Units
    Price
    Transaction date
    Memo NO
    and so on...

    Now lets say there are 5 rown in the worksheet which have same data for Account No, Account Name, Units & Transaction date. I need to write a macro which will keep first row and delete rest of the four.

    Any help will be greatly appriciated. I am using office 2003.

    Many thanks.

    Regards
    Deepak

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Deleting rows for duplicate data in few columns

    A non-macro solution would be to concatenate the 4 values together in a spare column, column H say. In column I you can then use a formula to produce a running count like: =COUNTIF($H$2:H2,H2) in I2 copied down. Paste special...values over column I and then delete any rows with a value greater then 1 in column I.

    Hope that makes sense.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Deleting rows for duplicate data in few columns

    Hi, Try :-
    Please Login or Register  to view this content.
    Regards Mick

  4. #4
    Registered User
    Join Date
    09-14-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Deleting rows for duplicate data in few columns

    hey huys,

    thanks a lot for replies.

    I shall try these solutions and i am sure it would work.

    many thanks.

    Regards
    Deepak

+ 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