+ Reply to Thread
Results 1 to 4 of 4

Delete entire row based on criteria

  1. #1
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Delete entire row based on criteria

    Morning all,

    I have attached an example worksheet. Sheets 1 and 2 show you how my data is now.

    To explain, based on the name column ('B') I would like the code to delete the ENTIRE ROW when a person only features on either sheet 1 or 2 (but not both). For example, in the attached the person called 'Dave' would be deleted from Sheet 1 because he only features on Sheet 1 and not Sheet 2.

    So if a person is present on both sheets then they are left alone. The spelling of each name will always be correct but the list of names may be in different orders (as they are in sheet 1 and 2 in the example).

    Thanks
    Attached Files Attached Files
    Last edited by D_N_L; 11-08-2011 at 09:13 AM.

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Delete entire row based on criteria

    Try it. Now rows are highlighted. If everything is correct, delete this line
    Please Login or Register  to view this content.
    and uncomment this line
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by nilem; 11-08-2011 at 10:21 AM. Reason: Fixed a bag in file

  3. #3
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Delete entire row based on criteria

    Hi,

    Here's a bit shorter code

    Please Login or Register  to view this content.
    Steffen Thomsen

  4. #4
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Re: Delete entire row based on criteria

    Guys, that is brilliant!!! Thanks so much!!

    I went with Steffen's in the end. Code was shorter. Thanks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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