+ Reply to Thread
Results 1 to 19 of 19

need formula for finding and removing orders

  1. #1
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    need formula for finding and removing orders

    Can any one help with what Im trying to do. I have a list of all of our Open line Items. I need a formula or VBA that can locate all orders that have Part #'s 2000 & 2005 and remove the entire order including the other part #'s on the same order. See example below.
    Noted the lines that need to be removed because there order contains a 2000 or 2005.

    A B C
    1 Order # Part # Qty
    2 137047 1951 2
    3 137050 1952 4
    4 137086 2000 1 Remove
    5 137086 1951 1 Remove
    6 137095 2000 2 Remove
    7 137096 2000 4 Remove
    8 137096 1955 1 Remove
    9 137100 1957 1
    Last edited by Kenekio; 11-05-2010 at 07:35 PM.

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: need formula for finding and removing orders

    Couldn't you just sort on the Part # and then delete those 2000 entries?

    I don't see why you have "REMOVE" adjacent to items 5 or 8 as they are not 2000 or 2005.

  3. #3
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    Quote Originally Posted by Cutter View Post
    Couldn't you just sort on the Part # and then delete those 2000 entries?

    I don't see why you have "REMOVE" adjacent to items 5 or 8 as they are not 2000 or 2005.
    I have to remove the entire order from this list and if I sort and delete the 2000 and 2005's I get the other items on those orders still on there. This is basically a flat file of all open orders. The entire Order containing 2000 & 2005 are shipped from another location. This includes numbers like1951,1952 that we have at both locations. I need to remove the whole order.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: need formula for finding and removing orders

    Without seeing sample file I may not be visualizing correctly but:

    Step 1
    Sort everything using Part #

    Step 2
    Delete Part # and Quantity data only for 2000 & 2005. Leave Order #'s intact

    Step 3
    Resort everything using Order #

    Step 4
    Delete Order #'s that have a blank anywhere in their range
    Last edited by Cutter; 11-05-2010 at 03:20 PM.

  5. #5
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    This will not work beacause I dont want any record of that entie order. Example: Order # 137086 is an order for 2 Part #'s Part # 2000 and Part # 1951. I am looking for something that can remove that entire Order from the list. If I sort and remove all rows with 2000, the rest of the order is still on the list. 137086 should be off the list completely.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: need formula for finding and removing orders

    I think you need to read my last post again.

    I didn't suggest removing "all rows with 2000"

    If you actually try what I suggested you might see what I mean.

  7. #7
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    How would I delete the order #'s with blank in there range? Sorry if im not getting it... also thank you very much for your replies

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: need formula for finding and removing orders

    I get it. If a part # is 2000 or 2005, look at the order # and delete all the rows with that order #.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  9. #9
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    Quote Originally Posted by JBeaucaire View Post
    I get it. If a part # is 2000 or 2005, look at the order # and delete all the rows with that order #.
    Exactly. Can u help?

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: need formula for finding and removing orders

    Here's a macro that will do it.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    You are Awesome. Work Fantastic. If I wanted to add new numbers that it would look up and remove orders for as well what would i have to add/change in the vba code. Im soooo stoked that you made this work so well.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: need formula for finding and removing orders

    Would you like a popup to ask?

  13. #13
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    Generally its always going to be the same #'s so I dont think it needs to ask but that would be a great feature. The actual file im using is much larger with many more columns and rows. I thought I could easily change the VBA but im running into an issue when I do so. What Would I have to do if the order numer was in Column "C" and Part# is in Column "AL". Also if you could tell me how easy it is to add more criteria to search for that would be cool. Im still in Awe that you created this in minutes and it works so well on my test sheet.

  14. #14
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: need formula for finding and removing orders

    Ok, this will ask you for the part numbers to delete, and it will find the ORDER # column and the PART # column wherever it is in row 1. Make sure the spelling is correct and matching the sample sheet you uploaded.

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    Maybe I dont get the row 1 part. Can I use this on a large spreadsheet where Order is in Column C and Part # is in column AL? Is this possible. Everything worked Great on Sample sheet with the 3 columns. Not sure Where to go with this large sheet tho

  16. #16
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    im sorry nevermind. I misread and I had my headers mis titled. That is great.

  17. #17
    Registered User
    Join Date
    11-05-2010
    Location
    Simi Valley, California
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: need formula for finding and removing orders

    Amazing!!!! You are Amazing. Thanks for all your help. Your a lifesaver!!!

  18. #18
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: need formula for finding and removing orders

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  19. #19
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: need formula for finding and removing orders

    If you have an updated need, post an updated workbook demonstrating the new problem.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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