+ Reply to Thread
Results 1 to 7 of 7

Delete rows that do not contain keywords in multiple columns

  1. #1
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Delete rows that do not contain keywords in multiple columns

    Greetings,

    I have this code that I found on the internet that will delete all rows that do not contain certain keywords in column C and move all the remaining rows up while retaining my Header row.

    Please Login or Register  to view this content.
    I'm working on a different project now and need to do essentially the same thing but the keywords are in different columns. I'm looking for "TIMESTAMP" in column C or "86563VLTM_2016_0F" in column D and keep only the rows that meet that criteria. Obviously, if I modify the code I have and run it twice (once for each keyword) the first one I run will delete the rows with the second keyword.

    I've tried changing the range (shown below) but I get an "Invalid use of Property" error.

    Please Login or Register  to view this content.
    I've also tried modifying these
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    with no luck.

    Obviously I'm a novice at this!

    Any help would be greatly appreciated. Thanks in advance.
    Last edited by PKW57; 09-04-2015 at 03:03 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Delete rows that do not contain keywords in multiple columns

    Try this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 08-28-2015 at 05:34 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Re: Delete rows that do not contain keywords in multiple columns

    Greetings,

    Sorry for the delay but I took a long weekend for some much needed downtime.

    I tested the code you gave me and it deleted everything regardless of the presence of the keywords.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Delete rows that do not contain keywords in multiple columns

    My bad. Try this...

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Delete rows that do not contain keywords in multiple columns

    Try:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Thumbs up Re: Delete rows that do not contain keywords in multiple columns

    Sweet!

    Thank you very much for your time!

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Delete rows that do not contain keywords in multiple columns

    Quote Originally Posted by PKW57 View Post
    Sweet!

    Thank you very much for your time!
    You're welcome. Thanks for the feedback.

+ 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. Delete Rows that Do Not Contain Multiple Keywords
    By Exia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2015, 07:41 PM
  2. How to combine 2 columns of multiple keywords
    By redsox88 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-30-2014, 01:47 PM
  3. Find multiple keywords in all columns and copying discovered rows into new sheet
    By noxfinitie in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 07-03-2014, 01:14 PM
  4. [SOLVED] Search for keywords and copy rows containing keywords to new sheet
    By lenorsk in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-15-2013, 06:54 AM
  5. [SOLVED] HDI - Return multiple keywords in a text column based on a set of available keywords
    By zneiley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2013, 01:32 PM
  6. search multiple columns and count number of rows the keywords appear
    By vincegc8 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2013, 02:01 PM
  7. Searching multiple columns for keywords
    By tranh in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 12-17-2007, 02:57 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