+ Reply to Thread
Results 1 to 4 of 4

Delete Row If Value in Cell does not Exist In Another Worksheet

  1. #1
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Delete Row If Value in Cell does not Exist In Another Worksheet

    Is there a way of checking if the cell values of column A in sheet 1 are contained in the cell values of column A in sheet 2.
    If they are not in column A of sheet 2 then delete the entire row within sheet 1

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete Row If Value in Cell does not Exist In Another Worksheet

    Assuming row1 is titles and data starts at row2...

    1) Use an empty column to add a MATCH() formula
    M2: =ISNUMBER(MATCH(A2, Sheet2!A:A, 0))

    2) Copy down the data set

    3) Filter column M for only the FALSE rows

    4) Delete them

    5) Remove the filter and clear the helper column

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    01-16-2013
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    136

    Re: Delete Row If Value in Cell does not Exist In Another Worksheet

    Thanks for your help

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete Row If Value in Cell does not Exist In Another Worksheet

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] how to run macro or msgbox when Worksheet does not exist/exist
    By herukuncahyono in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2013, 10:54 PM
  2. How to delete a worksheet if it doesn't exist in a list
    By iamrickdeans in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2013, 09:46 AM
  3. Delete row if value does not exist
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2010, 03:19 AM
  4. [SOLVED] Excel Worksheet Delete "Data may exist"
    By XidGarcia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2006, 09:45 AM
  5. [SOLVED] Copy Worksheet to a new Workbook creating if it doesn't exist and add more Worksheets if it does exist
    By pete.bastin@btopenworld.com in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2006, 01:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1