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
Solved

I need to take one list and remove all the name in there from another list using excel

Posted on 2014-01-16
6
246 Views
Last Modified: 2014-02-03
I have excel 2013.

I have list A and list B. I need to remove all the names that are in list B from list A.

How do I do that?
0
Comment
Question by:rdefino
6 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 39786276
Hi,

You could use a formula to compare the 2 lists

=IF(ISERROR(MATCH(C3,$A$1:$A$3,0)),C3,"")

Open in new window


EDIT
File
Regards
Mappe2.xlsx
0
 

Author Comment

by:rdefino
ID: 39786335
How do I use it? I have the list in column A and need to compare the list from column B and delete the duplicates from column A
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39786442
This macro will extract the unique values from list a (assuming range A2:A last used row) and list b (assuming range B2:B last used row) and put it in Column c.

Option Explicit

Sub Demo()

    Dim c As Range, d As Range, LR As Long
    Dim i As Integer

    For Each c In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
        If Not WorksheetFunction.CountIf(Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row), c.Value) >= 1 Then
            i = i + 1
            Range("C" & i).Value = c.Value
        End If
    Next c

End Sub

Open in new window

0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:rdefino
ID: 39786537
How do I run this macro?
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 250 total points
ID: 39786951
Enter it in the Microsoft Visual Basic Editor, then run it from the macro dialog.

To open the VBE (Visual Basic Editor), in 2007-2013 make sure the developer tab is visible.
If the tab does not show up on your screen, you can add it as follows:

For Excel 2010: click the File Tab then select options. On the left hand side of the Excel options dialog box, click Customize Ribbon. Then, on the right hand side box select Developer.
2010
For Excel 2007: click the Microsoft Office button, then Excel Options. In the Popular category, under Top Options for Working with Excel, select Show Developer Tab in Ribbon.
2007
Click the Developer tab on the Ribbon at the top of the screen.
Click on the Visual Basic icon in the Code section.
Click Insert from the VBE menu.
Click Module
Copy and paste the macro in the module.
Run the macro from the macro dialog http://www.dummies.com/how-to/content/how-to-run-an-excel-2010-macro.html
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 39788695
Very similar to this question:

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28337569.html

Uncanny similarity, as if you both have the same homework being set???
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

856 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