+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting: deleting entire rows

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Conditional formatting: deleting entire rows

    I need to delete rows that do not have the same number (a pair) in a column

    O A B C
    1 X 1 X
    2 X 1 X
    3 X 2 X
    4 X 2 X
    5 X 3 X
    6 X 4 X
    7 X 4 X
    8 X 5 X


    If the value in column b does not have the same value above/below than the whole row is deleted. Row 5 and 8 should be deleted in the example above.

    Can anyone provide assistance?

    Thank you.
    Last edited by CEM; 09-14-2010 at 04:51 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formating: deleting entire rows

    Let's say in D2

    =IF(OR(B1=B2,B2=B3),"Keep","Delete") dragged down.

    Then filter on D2 for "Delete" and select and delete those rows.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Conditional formating: deleting entire rows

    Thanks, thats it! Is there any way I could have the formula actually delete the row automatically without sorting?

    Thank you

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formating: deleting entire rows

    Formulas Won't delete rows. You could write VBA (a macro) to delete the rows.
    Also, I said Filtering, not sorting. Once you remove the filter, the order will be the same without the duplicates.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional formatting: deleting entire rows

    This macro should delete your duplicates
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-02-2010
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Conditional formatting: deleting entire rows

    Understood. Thank you.

+ 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