Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Dups()
Dim bDup as Boolean Do bDup = True for each cell in Activecell.EntireRow.Cells If cell.Value < Cell.Offset(1, 0).Value Then bDup = False exit for End If next if bDup then ActiveCell.Offset(1,0).EntireRow.Delete else ActiveCell.Offset(1,0).Select End if Loop Until isempty(ActiveCell.Value) End Sub -- Regards, Tom Ogilvy "SHiggins" wrote in message ... I am trying to remove duplicates in my data where the entire row matches the one under it. So far I have it where it checks just one cell to see if it matches. How do I have it look at the entire row? Thanks! Here is my code so far: Sub Dups() Do If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then 'ActiveCell.EntireRow.Delete ActiveCell.Offset(1, 0).EntireRow.Delete Else ActiveCell.Offset(1, 0).Activate End If Loop Until ActiveCell.Value = Empty End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking for Duplicates within a Workbook | Excel Worksheet Functions | |||
checking for duplicates | Excel Worksheet Functions | |||
Error Checking for Duplicates in List | Excel Worksheet Functions | |||
Checking for duplicates - think this is simple | Excel Discussion (Misc queries) | |||
Checking for duplicates? | Excel Programming |