View Single Post
 
Old 07-02-2014, 04:46 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,520
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

The best way to remove duplicates would be to sort the worksheet after it's been updated, then remove the duplicates. So, after:
wdApp.Quit
insert:
Code:
Dim lRow As Long, j As Long
With WkBk
  For i = 1 To .Worksheets.Count
    With .Worksheets(i)
      lRow = .UsedRange.Rows.Count
      For j = lRow To 1 Step -1
        If Application.WorksheetFunction.CountIf(.Columns(1), .Range("A" & j)) > 1 Then
          .Range("A" & j).EntireRow.Delete
        End If
      Next j
    End With
  Next i
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 07-02-2014 at 04:58 PM. Reason: Code revision
Reply With Quote