![]() |
|
#11
|
||||
|
||||
|
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 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find specific rows then copy and paste to new doc
|
konopca | Word VBA | 5 | 02-20-2014 02:34 PM |
How to allow specific double words in spellcheck
|
Wyndham | Word | 5 | 02-06-2014 10:44 AM |
Need VBA For Macro On How To Remove Specific Words
|
netchie | Word VBA | 6 | 08-28-2012 03:37 PM |
Macro to copy specific columns in Excel from another spreadsheet
|
KD999 | Excel Programming | 1 | 07-20-2012 08:58 AM |
Macro for highlighting specific number of words
|
icsjohn | Word VBA | 2 | 12-07-2011 06:44 PM |