+ Reply to Thread
Results 1 to 2 of 2

delete rows not matching certain criteria

  1. #1
    Registered User
    Join Date
    03-23-2005
    Posts
    33

    Red face delete rows not matching certain criteria

    Is there anyway way to delete those rows not matching certain criteria ?
    For example, required rows in Column A - always have either xxxxx-x formatted Account# or Date or word begins with "Total :" anything other then this- those rows are not useful and i want to automatically delete all those unwanted rows.
    Delete the the rows which has value other then xxxxx-x formatted account# or date or word "Total :"
    [Account# could be xxxxx-x or xxxx-x or xxx-x or xx-x or x-x means 5digit-1digit or 4digit-1digit or 3digit-1digit or 2digit-1digit or 1digit-1digit
    Data is huge so cannot do by auto filter. Need Macro.
    Thanx a lot

    ====INPUT====
    Column A
    56981-3
    1459-3
    10/25/2010
    69655-9

    Apple
    Orange
    Total:
    01/02/2009

    Paint1
    987-1
    Yellow
    Total:

    ====OUTPUT===
    Column A
    56981-3
    1459-3
    10/25/2010
    69655-9

    Total:
    01/02/2009

    987-1
    Total:

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: delete rows not matching certain criteria

    Hello,

    Please try this code, I hope it helps:
    Please Login or Register  to view this content.
    Last edited by MaczaQ; 10-08-2011 at 04:41 PM. Reason: code clean up :)
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

+ 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