Deleting entire duplicate rows

Ionisation

New Member
Joined
Oct 6, 2006
Messages
3
I have a document with over 1000 rows of data. Amongst this data are duplicate rows scattered between.

Can i find and delete these duplicate rows with one or two click?

Duvall
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

stuartford

Active Member
Joined
Nov 28, 2002
Messages
419
you could sort the data by the column containing the duplicate rows then run a vba If statment

Sub tst()



For n = 1 To 1000
If Cells(n, 1) = "" Then
End
Else
End If
If Cells(n, 1) = Cells(n + 1, 1) Then
Cells(n + 1, 1).EntireRow.Delete
n = n - 1

Else

End If

Next n
End Sub



Hope this is of some help

Stu
 

mikewg

New Member
Joined
May 8, 2006
Messages
9
What if you don't know for sure that there's 1000 rows of data? For example, some days there's 500 and some days there's 1500? I know there's always less than 5000, so I run a macro deleting rows from 1-5000, but the macro takes a long time to complete knowing that most of the rows it checks are completely blank. I could speed up the macro if it just looked at the rows that contained data - however, I'm not sure that any particular column will contain data (for example, Col A could be blank and Col B have data for one row, but in another it's switched). Thoughts?
 

Watch MrExcel Video

Forum statistics

Threads
1,114,093
Messages
5,545,917
Members
410,711
Latest member
Josh324
Top