|
-
Oct 10th, 2003, 11:40 AM
#1
Thread Starter
New Member
Find duplicate rows in Excel
How do I find(not delete) duplicate rows in an excel spreadsheet(about 3000 rows), bring them adjucent and may be highlight them?
Before posting, I searched this forum with "duplicate rows".
-
Oct 10th, 2003, 05:43 PM
#2
Fanatic Member
The AdvancedFilter will find all "unique" items. So, everything else must be a duplicate. If you highlight everything, then unhighlight the unique items, you have highlighted all duplicates.
VB Code:
Sub MakeDupsYellow()
Dim myRange As Range
Dim strColToSort As String
'Note: first cell in column is considered a heading
' and is not included in the filter.
strColToSort = "A"
Application.ScreenUpdating = False
Set myRange = Columns(strColToSort & ":" & strColToSort)
myRange.Interior.ColorIndex = 36
myRange.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
myRange.Interior.ColorIndex = xlNone
ActiveSheet.ShowAllData
Application.ScreenUpdating = True
End Sub
-
Oct 14th, 2003, 09:42 AM
#3
Thread Starter
New Member
Thanks WorkHorse. Works super!
-
Nov 22nd, 2010, 11:59 AM
#4
New Member
Re: Find duplicate rows in Excel
How do I find the duplicate rows (not delete) when both the first and second column together (first name and last name) need to be found.
-
Nov 22nd, 2010, 03:36 PM
#5
Re: Find duplicate rows in Excel
you should have started a new thread for your question rather than resurrecting one from nearly 10 years ago
you can use countif on first column, if > than1 then loop through with vlookup and check matches in second column, i believe, there would even be some formula to do this
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|