View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_4_] Patrick Molloy[_4_] is offline
external usenet poster
 
Posts: 103
Default exel macro to eliminate duplicate record

There's really no need to make cells active this way - unless you like to
see the screen updating.

Sub Delete_Row()

Dim target as range
set target = activecell
Do

If Target.Value = Target.Offset(1, 0).Value Then
Target.Offset(1, 0).EntireRow.Delete
Else

Ste target = target.Offset(1, 0)
End If

Loop While target.value< ""

End Sub




--
Patrick Molloy
Microsoft Excel MVP
---------------------------------
I Feel Great!
---------------------------------
"Soo Cheon Jheong" wrote in message
...
Try

Sub Delete_Row()

Do

If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
ActiveCell.Offset(1, 0).EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If

Loop While ActiveCell < ""

End Sub

__