Results 1 to 4 of 4

Removing Duplicate Record From another Sheet

This is a discussion on Removing Duplicate Record From another Sheet within the Excel Questions forums, part of the Question Forums category; Hay Guys, Ive now gotten to the stage where I have 2 worksheets coloumn a) in each sheet has a ...

  1. #1
    Board Regular pantsmonkey's Avatar
    Join Date
    Jul 2002
    Posts
    109

    Default Removing Duplicate Record From another Sheet

    Hay Guys,

    Ive now gotten to the stage where I have 2 worksheets coloumn a) in each sheet has a site address that can contain spaces.

    I would like a way for to check for exact copies of the contents of cell a) in sheet 1 and sheet 2, If the there is an exact match in both sheets I would like that row to be deleted from sheet 1.

    Is this possible ?

    Sorry to be a pain someone just dumped this on me at lunchtime (not my job and ive got a out of state flight booked for 2 hours from now)


  2. #2
    Board Regular RichardS's Avatar
    Join Date
    Feb 2002
    Location
    Victoria, Australia
    Posts
    761

    Default Re: Removing Duplicate Record From another Sheet

    Modify that countif formula in Sheet 1

    =COUNTIF(Sheet2!$A:$A,Sheet1!A1)

    Paste the results as values. Any with a value of 1 or above has an extact match in sheet 2. Sort by the formula column, then delete all those rows.

    Or are you only looking for matches in the same row? A1 in Sheet 1 has an exact macth in A1 in Sheet 2?

    =MATCH(A1,Sheet2!A1:A1,0)

    Returns #N/A if no match, so keep those records.

    Richard
    If absence makes the heart grow fonder and familiarity breeds contempt, perhaps my wife should live in Darwin?

  3. #3
    Board Regular
    Join Date
    Jan 2004
    Location
    Melbourne
    Posts
    3,459

    Default Re: Removing Duplicate Record From another Sheet

    With little time, here is the quick and nasty way:

    In sheet 1, use lookup formulas like this:

    =vlookup(A1,Sheet2!a:a,1,false)

    Filter sheet1 on everything except "#N/A" and then delete each visible line.

    There are three kinds of people - those that can count and those that can't.

  4. #4
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,452

    Default Re: Removing Duplicate Record From another Sheet

    Hi pantsmonkey:

    And here is a macro based approach ...
    Code:
    For i = Sheets("Sheet1").Range("A65536").End(xlUp).Row To 1 Step -1
            yRow = 0
            On Error Resume Next
            yRow = WorksheetFunction.Match(Sheets("Sheet1").Cells(i, 1).Value, Sheets("Sheet2").Range("A:A"), 0)
            If yRow > 0 Then Sheets("sheet1").Cells(i, 1).EntireRow.Delete
        Next
    Regards!

    Yogi Anand, D.Eng, P.E.
    Energy Efficient Building Network LLC
    www.energyefficientbuild.com

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
  •  


DMCA.com