+ Reply to Thread
Results 1 to 3 of 3

Lookup and delete line if found

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Lookup and delete line if found

    So I attached a very simplistic example book to explain what I am looking for.

    Say I have accounts 1 to 20 on tab 1 and on tab 2 if have some numbers corresponding with one of the number 1 to 20.
    I my example I have 4,7,11,14.

    What I was trying with worksheetfunction.vlookup or application.vlookup to lookup the range 1 to 20 on sheet 2.

    If the number I was looking op at that time was present on sheet 2 it needs to delete the entire line (an move all up) and check the next number.

    Can not get that straight. All help is appreciated.
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: Lookup and delete line if found

    You can loop through the first sheet and use find to see if it is in the second sheet.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Re: Lookup and delete line if found

    Thanks davesexcel!

    A solution with Find is fine by me.
    Was looking into vlookup but Find is probably faster anyway as the data has about 1400 lines.

+ 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. Move row to new sheet and delete - Explain this code line by line
    By omoHF in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-11-2018, 12:38 PM
  2. Found?, then delete entire rows. Not found end sub
    By Andrewstupendo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2018, 01:56 PM
  3. Delete rows until the next value is found.
    By naryfa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2014, 12:49 PM
  4. Replies: 3
    Last Post: 03-04-2014, 04:55 AM
  5. Line selection when row found .
    By ciprian in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-30-2011, 06:34 AM
  6. Resuming at certain line after variable not found
    By omgeokid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-15-2011, 10:32 AM
  7. [SOLVED] Insert Blank Line after the Word Category is found
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2006, 01:50 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