+ Reply to Thread
Results 1 to 2 of 2

Macro to keep rows that have certain text in one column, delete rows that do not.

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    Erie, PA
    MS-Off Ver
    2010
    Posts
    1

    Macro to keep rows that have certain text in one column, delete rows that do not.

    I need a macro that will go through all the cells in column B and if the text in the cell does not match one of the states listed in the code then the entire row needs to be deleted. Also it needs to skip over any blank rows and not delete them.
    Thanks any help is greatly appreciated.
    Here's my code.

    Please Login or Register  to view this content.
    Last edited by mandalope; 07-24-2014 at 02:44 PM.

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Macro to keep rows that have certain text in one column, delete rows that do not.

    Hi mandalope,
    Welcome to the Forum.

    Unfortunately Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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: 5
    Last Post: 11-12-2012, 08:38 PM
  2. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  3. [SOLVED] Delete all rows where Column A contains Text
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 AM
  4. Delete all rows where Column A contains Text
    By D Hafer - TFE in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] Delete all rows where Column A contains Text
    By D Hafer - TFE in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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