+ Reply to Thread
Results 1 to 7 of 7

Delete rows in data where column B doesn't meet criteria

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Delete rows in data where column B doesn't meet criteria

    Hi,

    In the attached example, I have a list of Basketball matches in column B and what I want to do is reduce the list (by deleting unwanted rows, not filtering) to matches that just contain NBA matches. The full version of my data will contain thousands of rows so you can imagine this will save me a lot of hard work not manually go through each row.

    In the worksheet 'Team List', I have a list of the team names to verify which matches to keep. Basically, any row in column B that does not contain a team name from my 'Team List' wants to be deleted. There is a couple of teams that look like duplicates in my team list but that's because they have been spelt slightly differently in the original data set. Therefore, it is right to keep both spelling of Cleveland Cavaliers in the Team List.

    Any help, much appreciated.

    Cheers,
    Adam.
    Attached Files Attached Files

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,956

    Re: Delete rows in data where column B doesn't meet criteria

    Quick question...What is the criteria of row delete?
    Must both Teams be found in Team list to be kept or....
    If only one of the teams are found in Team list row must be kept
    If no teams are found then the row be deleted....

    Try this long way....
    Please Login or Register  to view this content.
    Last edited by Sintek; 07-01-2017 at 08:41 AM. Reason: ScreenUpdating in reverse lol.....Thanks xladept
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Delete rows in data where column B doesn't meet criteria

    Hi Sintek,

    Thanks for your reply. In answer to your question, both of the teams names in the fixture name in column B, must be present in the 'Team List'.

    I'm not sure if you have accounted for this in your code but when I just tried to run the code, it didn't seem to remove any rows at all.

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,956

    Re: Delete rows in data where column B doesn't meet criteria

    both of the teams names in the fixture name in column B, must be present
    Then try amended code in post 2

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Delete rows in data where column B doesn't meet criteria

    adam2308

    Try this one.
    Should be very fast.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Delete rows in data where column B doesn't meet criteria

    perfect jindon - very clever!

    One thing I didn't pick up on is I would also need to delete the rows that have "(Specials)" within the fixture name? Any chance we can add a bit more code to deal with this?

    Thanks.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Delete rows in data where column B doesn't meet criteria

    Try change to
    Please Login or Register  to view this content.

+ 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. Replies: 0
    Last Post: 03-18-2015, 11:30 AM
  2. Replies: 7
    Last Post: 10-23-2012, 08:38 AM
  3. How to delete all rows with the same name as a row that meet a certain criteria.
    By shaihulud in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-19-2010, 04:50 PM
  4. Delete rows that do not meet specific criteria
    By SITCFanTN in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2006, 11:36 AM
  5. [SOLVED] Macro, delete rows that meet criteria
    By Scott Wagner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-22-2005, 08:10 PM
  6. Delete Rows where cells does not meet criteria
    By Danny in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-12-2005, 01:05 PM
  7. how do i delete rows when cells meet certain criteria?
    By Tbal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2005, 01:05 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