View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
flipme1 flipme1 is offline
external usenet poster
 
Posts: 4
Default Deleting Repetitions

Try this... not too clean but it should work

Sub deldup()
r = 1
While Cells(r, 1).Value < ""
cv1 = Cells(r, 1).Value
cv2 = Cells(r + 1, 1).Value
If cv1 = cv2 Then
Rows(r + 1).Select
Selection.Delete
r = r - 1
End If
r = r + 1
Wend
End Sub


"teresa" wrote:

Hi, I have a list of 100 numbers which frequently repeat themselves,
I need to delete the rows with repetitions, leaving only unique entries ,
my code is missing a few lines, help is much appreciated

1
2
3
1
13
.
.
3
Sub del()

For i = 1 To 10
For j = 1 To 10

If Cells(i, 1) = Cells(j, 1) Then
Cells(i, 1).Rows.Delete
End If
Next
Next
End Sub