Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 07-02-2014, 04:46 PM
macropod's Avatar
macropod macropod is online now copy a specific words to excel list Windows 7 32bit copy a specific words to excel list Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
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
 



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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft