+ Reply to Thread
Results 1 to 3 of 3

Delete Rows Based on Column Criteria

  1. #1
    Registered User
    Join Date
    05-17-2010
    Location
    toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Delete Rows Based on Column Criteria

    hey everyone,

    Everyday I have to do the same thing on excel, one of those jobs is to retrieve specific rows of data from a file that is 6000 rows long... What I do is:

    -sort the data by 'Part Number' (column E)
    -Select all rows where part number starts with anything other than "D" or "V"
    -delete those selected rows (but not deleting the 1st row)

    by now I have a data set the consists of just rows with Part #s that begin with D and V.. then I do some other stuff that is not relevant to this code.

    So I'm sure there must be a way to code this in VBA instead of doing it manually everyday... i found this website which has code that deletes rows, based on what you tell it to delete, but I need the opposite, I want to tell it what not to delete and have it delete everything else (except the first row).
    HTML Code: 

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Delete Rows Based on Column Criteria

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    05-17-2010
    Location
    toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Delete Rows Based on Column Criteria

    Good idea..
    here is a sample file with Before and After tabs...I had to zip it to make it less than the limit
    Attached Files Attached Files
    Last edited by telnoman; 07-22-2010 at 09:34 AM.

+ 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