View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
excelent excelent is offline
external usenet poster
 
Posts: 695
Default Removing duplicate rows

this kode put "Dublicate" in column 10 (J) if is a dublicate
and check in column 1,2 and 5-9
i hope i got ur right

Sub SletDubletter()

Dim r, t, t2, t3, rw, tValue()
t3 = Cells(65500, 1).End(xlUp).Row
ReDim tValue(t3)
For rw = 1 To Cells(65500, 1).End(xlUp).Row
tValue(rw) = Cells(rw, 1) & Cells(rw, 2) & _
Cells(rw, 5) & Cells(rw, 6) & Cells(rw, 7) & Cells(rw, 8) & Cells(rw, 9)
Next
For t = 1 To UBound(tValue)
If tValue(t) < "" Then
For t2 = t + 1 To UBound(tValue)
If tValue(t) = tValue(t2) Then
tValue(t2) = "Dublicate"
End If
Next
End If
Next
For t = 1 To UBound(tValue)
If tValue(t) = "Dublicate" Then Cells(t, 10) = tValue(t)
Next

End Sub