Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie question on deleting duplicate rows
I'm an Excel VBA newbie trying to delete rows from a spreadsheet based
upon duplicated values in a particular column (the sheet has been sorted by the column of interest). I want the macro to compare the value of the activecell with the value of the cell in next row (same column). If the values are identical I want the entire row beneath the current row to be deleted. I suspect the code below is slow (if I could get it to run), but I'd love to see what I'm doing wrong. Any help would be appreciated. Thanks LastRow = Selection.SpecialCells(xlLastCell).Row For x = 1 To LastRow If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then ActiveCell.Offset(1, 0).EntireRow.Delete End If ActiveCell.Offset(1, 0).Select Next x Thanks Phil Horwood |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting duplicate rows | Excel Discussion (Misc queries) | |||
Find duplicate rows then deleting them | Excel Worksheet Functions | |||
deleting duplicate rows | Excel Discussion (Misc queries) | |||
Deleting duplicate rows | Excel Discussion (Misc queries) | |||
Deleting Duplicate Rows | Excel Discussion (Misc queries) |