+ Reply to Thread
Results 1 to 5 of 5

delete entire row if this AND if this...?

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    delete entire row if this AND if this...?

    Hello!

    I would need to ask the local excel gods again for some help please
    I have a list with arrivals from VIPs, their arrival date in column C and their name in column I. Now, I would like to clear out all double bookings (two bookings under the same name) but on the same arrival date only! If there are 2 bookings under the same name, then I would need one entry (row) deleted.
    So basically the macro needs to find all entries with the same arrival date and then check if it has any double bookings, means 2 entries with 100% exactly the same name, and if yes, delete one of them. Afterwards, move on to the next day.

    FYI, the list is not sorted by the arrival date if that matters.

    Thanks in advance for all your help!
    A2k

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

    Re: delete entire row if this AND if this...?

    This little macro should take care of it for you. It uses two empty columns AA and AB to make a deletion key and delete the dupes all at once. This should be FAR faster than "looping" through all the rows one at a time.

    If AA and AB aren't empty, just adjust the macro out to two columns that are empty.

    Please Login or Register  to view this content.
    _________________
    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!)

  3. #3
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: delete entire row if this AND if this...?

    Hi!

    thanks for the help. unfortunately it gets stuck at the indicated line:
    Please Login or Register  to view this content.
    excels screams error 1004 (object error). Well, the cells actually are empty, just in case i changed them and redid the whole thing, without success though. hmmm, any plan?

    thanks a lot though!
    A2k
    Last edited by Armitage2k; 09-16-2009 at 11:35 AM.

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

    Re: delete entire row if this AND if this...?

    You can see the -1 is missing in the third bracket. Fix that. [-1]

    Sorry about that, somehow lost a digit during the copy to the forum.

  5. #5
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: delete entire row if this AND if this...?

    yep,works. fixed the "1" as well as the first bracket (was { instead of [). Works well now, thanks a lot!

    A2k

+ 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