+ Reply to Thread
Results 1 to 11 of 11

Delete rows based on 3 columns

  1. #1
    Registered User
    Join Date
    06-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Delete rows based on 3 columns

    Hi,
    I have 3 columns with data.

    I want to delete the entire row if these 3 columns are having the same data.

    Do you know how I can do this..


    Thanks!

    Nithin

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Delete rows based on 3 columns

    Just curious, would you have people guess the three columns or better yet, exactly which cells? Would you also have people guess the criteria of the data?
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    06-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Delete rows based on 3 columns

    Its column A, B and C .. If they all have "Data invalid", then I want to delete the entire row.
    If its its just 2 columns and the 3rd column has data, then I want to retain the row.

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Delete rows based on 3 columns

    Just to make this clearer, if A2 = Data invalid and B2 = Data invalid and C2 = Data invalid then delete Row 2 else leave it alone?

  5. #5
    Registered User
    Join Date
    06-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Delete rows based on 3 columns

    Yes all 3 columns have "Data Invalid" then only delete the entire row.. Thanks!

  6. #6
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Delete rows based on 3 columns

    Alright, try the following on a sample set of data
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Delete rows based on 3 columns

    I copy pasted the same code and changed the name of the Sheet1 to my sheet name..
    It didnt work..

  8. #8
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Delete rows based on 3 columns

    Hi nitin1309,

    Sorry about that, I didn't take into account case sensitivity. Try the following
    Please Login or Register  to view this content.

  9. #9
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Delete rows based on 3 columns

    So does this solve your problem? I see you've come back to see my last post but you haven't marked it as solved, given a rep point, or even responded to let me know.

    Seriously!

  10. #10
    Registered User
    Join Date
    06-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Delete rows based on 3 columns

    Mordred, you need to chill out dude..

    I really appreciate you taking out your precious time in helping me out but the Excel Sheet I had constructed had a lot of other logic in it and it crashed this morning.
    Which means that I am re-creating all those VBA scenarios before I can implement your code..

    And I have been thrown under the bus to do 12 more tasks since my team's off-shore production failed..

  11. #11
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Delete rows based on 3 columns

    I don't need to chill, and your problems aren't mine own. Being respectful to those that help takes a person a long way. I have a passion for helping people and sometimes people need to be held in check. Check!

+ 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