Solved

Duplicate rows in excel

Posted on 2011-02-15
2
346 Views
Last Modified: 2012-05-11
Please look at the attached duplicatesexamplea.xls.

I need to identify any duplicates in Sheet1 column B.  My result should look like Sheet2.

How can I do this?

duplicatesexamplea.xls
0
Comment
Question by:EEuser5551212
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 24

Accepted Solution

by:
StephenJR earned 250 total points
ID: 34897565
A macro solution:
Sub x()

Dim r1 As Range, r2 As Range

With Sheets("Sheet1")
    Set r1 = .Range("B1", .Range("B1").End(xlDown))
    For Each r2 In r1
        If WorksheetFunction.CountIf(r1, r2) > 1 Then
            Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp)(2).Resize(, 2).Value = r2.Offset(, -1).Resize(, 2).Value
        End If
    Next r2
End With

End Sub

Open in new window

0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question