+ Reply to Thread
Results 1 to 3 of 3

Remove rows based on list of words

  1. #1
    Registered User
    Join Date
    04-24-2013
    Location
    Marbella
    MS-Off Ver
    Excel 2007
    Posts
    2

    Remove rows based on list of words

    Hi Everyone

    I have attached a simple test spreadsheet that contains two worksheets.

    The first "domainnames" contains a list of domain names. I have included a sample set of 35 rows but there will be maybe 1000 or more.

    The second "spamwords" is a list of words that I want to use to remove all rows if any of the words in the "spamwords" list are contained within the "domainnames" worksheet.

    So as an example if the word "shoes" in "spamwords" worksheet is present in any of the rows in the worksheet "domainnames I would like the row to be deleted.

    In this this example it would remove the rows soccersshoes-usa.com hothotshoes.com & running-shoesby.com from the "domainnames" worksheet

    Hope that makes sense

    thanks for your time to read this post
    Attached Files Attached Files

  2. #2
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Remove rows based on list of words

    use advanced filter
    see attached

    advanced filter.
    ignore any "could not determine range" messages if they pop up"
    select filter list in place

    select col a

    list range should show domainnames!$A:$A
    click in criteria range
    select b1:b7
    click ok
    note the top of the criteria range has the same name as the top of the range to be filtered
    also a formula has been used to append wildcard * to each end of the names from spamwords
    once filtered you can simply select all the rows and delete
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    04-24-2013
    Location
    Marbella
    MS-Off Ver
    Excel 2007
    Posts
    2

    Talking Re: Remove rows based on list of words

    Awesome! It worked. Thanks for your work on this it really is appreciated

    To put the cherry on the top as I have to run this several times daily I was trying to put it in a macro I have encountered two problems

    1. Determining the entire list range and criteria range of both the domainnames and spamnames lists. These both change constantly on each run.

    2. I want to keep a separate external spreadsheet with solely a list of spamnames that I could reference using your technique?

    great work !

+ 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