How to delete that row if same cell in preceding row is identical
I have data that duplicates a cell in the previous row and I want to delete
the second row each time that happens. |
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. |
How to delete that row if same cell in preceding row is identical
"Office_Novice" wrote in message
... ActiveCell.EntireRow.Delete Shift:=xlUp For reference, when you delete an entire row, there's only one way to shift.... |
All times are GMT +1. The time now is 11:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com