View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Judd Jones[_2_] Judd Jones[_2_] is offline
external usenet poster
 
Posts: 12
Default Deleting duplicates

I found this code he

Sub DeleteDuplicates()
'Deletes Duplicates in column called out "C"
Dim LastRow As Long
Dim i As Long
Application.ScreenUpdating = False
LastRow = Range("C" & Rows.Count).End(xlUp).Row
For i = LastRow To 1 Step -1
If WorksheetFunction.CountIf(Range("C:C"), Range("C" & i)) 1 Then
Range("C" & i).EntireRow.Delete
End If
Next 'i
Application.ScreenUpdating = True
End Sub

I am needing this changed to only delete column C and D.

Thanks in advance.