View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Office_Novice Office_Novice is offline
external usenet poster
 
Posts: 245
Default How to delete that row if same cell in preceding row is identical


Sub NewOne()
Do Until ActiveCell.Value = ""
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
ActiveCell.EntireRow.Delete Shift:=xlUp
ElseIf ActiveCell.Value < ActiveCell.Offset(-1, 0).Value Then
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub

"Ronmarco" wrote:

I have data that duplicates a cell in the previous row and I want to delete
the second row each time that happens.