+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP & Delete Rows

  1. #1
    Registered User
    Join Date
    07-18-2009
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    Excel 2003
    Posts
    2

    VLOOKUP & Delete Rows

    This is Neaz. And this is my very first post in excelforum.

    Here goes the scenario. Please try to understand first:

    Sheet1:
    Column A--- Column B--- Column C
    Neaz ---------- math ----------- 95
    Jean -------- Geography -------- 75
    John ---------- English ----------- 85
    Reese --------- physics ---------- 90

    Sheet2:Column A
    John
    Reese

    What I want is that I want to check whether Column A of Sheet 2 matches with Column A of Sheet 1. Then I want to get deleted those cells from Column A of Sheet 1 which matches with Column A of Sheet 2. Or, I want to get deleted the whole row of those cells from Column A of Sheet 1 that matches with Column A of Sheet 2.

    Therefore the outcome of Column A of Sheet 1 will be:

    Column A --- Column B --- Column C
    Neaz ----------- math ---------- 95
    Jean ------- Geography --------- 75

    I hope i'm clear.

  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: VLOOKUP & Delete Rows

    Hi soulfly, welcome to the forum. Yes, that's clear. For this I would add a column to sheet 1. Let's call column D "Key", and in D2 put this formula:

    =COUNTIF(Sheet2!$A:$A,$A2)>0

    Now copy that cell down the whole dataset. You now have TRUE/FALSE answers for each name.

    Click on A1 and select DATA > FILTER > AUTOFILTER to turn it on.

    Now click on D1's drop box and select FALSE to see only the names that AREN'T on Sheet 2.

    The benefit of this approach is that it let's you filter by whatever criteria you want, hiding the rows that don't fit the criteria without actually deleting them.

    Now, if you really WANT to delete the rows, autofilter for "True" answers, then highlight the visible data and select EDIT > DELETE ROW. Then set the Autofilter to "All" to get the remaining data to show.
    _________________
    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
    Registered User
    Join Date
    07-18-2009
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    Excel 2003
    Posts
    2

    re: VLOOKUP & Delete Rows

    Thanks for your valuable reply. I was looking for it for long. I'm lucky to be part of this forum.

    Let me try, I will knock again if I face any prob

    --------------------------

    Fantastic... it worked... Thanks a million
    Last edited by soulfly; 07-18-2009 at 10:00 AM.

  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: VLOOKUP & Delete Rows

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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