Thread: [Solved] Consolidate names
View Single Post
 
Old 05-13-2013, 07:10 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could try a macro like:
Code:
Sub DeleteDuplicates()
Application.ScreenUpdating = False
Dim LRow As Long, i As Long, j As Long, k As Long, bDel As Boolean
With ActiveSheet
  LRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
  For i = LRow To 2 Step -1
    For j = i - 1 To 1 Step -1
      If .Cells(i, 1).Value = .Cells(j, 1).Value Then
        If .Cells(i, 2).Value = .Cells(j, 2).Value Then
          For k = 3 To 6
            If .Cells(i, k).Value <> "" Then
              bDel = True
              Exit For
            End If
          Next
          If bDel = True Then
            .Rows(j).EntireRow.Delete
          Else
            .Rows(i).EntireRow.Delete
          End If
        End If
      End If
    Next
  Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote