+ Reply to Thread
Results 1 to 5 of 5

Complex logic formula to delete values

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Complex logic formula to delete values

    The concept is fairly simple but the logic is not. Basically I have some values that repeat themselves and need to be deleted when they repeat. Please see the attached file for further details (you need the additional details to answer this question).


    upon further consideration I thought that it would be best to probably do everything in two passes or maybe not see below macro to get an idea of how the end process should function

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by randell.graybill; 11-14-2009 at 11:45 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Complex logic formula to delete values

    Does this work for you ?

    Test on a backup sheet first of course!

    Please Login or Register  to view this content.
    I think in reality given the almost recursive nature of the calcs you need to iterate from top to bottom ... given latter rows may appear as though they are duplicates until such time as earlier rows are removed (eg row 23)
    ie you can only really determine unique nature of a given row as and when it is reached and all preceding rows have been dealt with accordingly (eg rows 21 & 22)

    I suspect the above can be improved but this is more a test to see if the logic matches requirements.

  3. #3
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: Complex logic formula to delete values

    I believe I understand what you are trying to do, and yes the logic is correct, at this point the macro doesn't do anything however...the it seems it should work is when the values in column IV equal 1 in row subsequent rows then both rows should be deleted. The logic is perfect the macro doesn't delete the data...and I don't know why the macro looks sound.

  4. #4
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: Complex logic formula to delete values

    Donkey using the code you gave me I got it to work not so pretty (my code not yours) but it does the job. Thanks for the help!

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: Complex logic formula to delete values

    upon further examination it appears that it didn't delete everything in one pass...

    [edit]

    while the above is true it is no fault of the logic...it is due to there being a 3rd pallet with the same number...and since this happened to only 4 it is not important to fix it. thanks again Donkey.
    Last edited by randell.graybill; 11-14-2009 at 11:46 PM.

+ 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