View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
DKY[_71_] DKY[_71_] is offline
external usenet poster
 
Posts: 1
Default delete rows if value in column D is repeated


I found this, but it doesn't quite seem to be working.

Sub del()
Dim j As Long
Dim i As Long
j = Cells(Rows.Count, 4).End(xlUp).Row
For i = j To 1 Step -1
If WorksheetFunction.CountIf(Range("D1:D" & j), Cells(i, 1).Value) 1
Then
Cells(i, 1).EntireRow.delete
End If
Next i
End Sub


--
DKY
------------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=395321