+ Reply to Thread
Results 1 to 5 of 5

For each unique value in col A+B, removing lines based on column C

  1. #1
    Registered User
    Join Date
    12-15-2009
    Location
    Houston, TX, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    For each unique value in col A+B, removing lines based on column C

    In the attached dataset, I am looking for a way to accomplish the following:

    For each unique value of Order Number [col A] + Line Number [col B], I need a program which will locate the first instance of Next Stat [col D] = 530 and the first instance of col D = 540, deleting the other lines. The output will have two lines remaining for each unique col A+B combination, one where col D = 530 and another = 540.

    The data will always be sorted in date/time order prior to running this program. The actual data set has a varying number of lines, usually 1000+.
    Attached Files Attached Files
    Last edited by smokebreak; 01-21-2010 at 12:00 PM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: For each unique value in col A+B, removing lines based on column C

    Hi, Try the code in the returned file.
    Regards Mick
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-15-2009
    Location
    Houston, TX, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: For each unique value in col A+B, removing lines based on column C

    Can you please show me how to enable this code in my own worksheet, without using the button?


    [edit: code works, I have no idea how you did it... but I'm glad you did]
    Last edited by smokebreak; 01-21-2010 at 12:00 PM. Reason: figured it out

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: For each unique value in col A+B, removing lines based on column C

    Hi, Can I assume you've got it to work, and it does what you want it t do.???
    Regards Mick

  5. #5
    Registered User
    Join Date
    12-15-2009
    Location
    Houston, TX, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: For each unique value in col A+B, removing lines based on column C

    Quote Originally Posted by MickG View Post
    Hi, Can I assume you've got it to work, and it does what you want it t do.???
    Regards Mick
    That is correct! Worked like a charm, that's why I love this forum!

+ 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