+ Reply to Thread
Results 1 to 5 of 5

Delete Multiple Rows Based on Criteria in 1 Column

  1. #1
    Registered User
    Join Date
    01-11-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Delete Multiple Rows Based on Criteria in 1 Column

    Hello
    Please have a look at the attachment.
    Column A is employee numbers. With each grouping of employee numbers, if the last record in column B is blank - I want to delete all the rows for that employee.
    So, with that in mind - I only want to be left with the data in rows 13, 14, 17, 18, 20, 28.
    How do I do that?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Delete Multiple Rows Based on Criteria in 1 Column

    Kind of crude (works on sample workbook):
    It goes down column B searching for empty cells. When one is found, it checks the adjacent A, if it has data, the entire block, plus the next row is hidden.
    When all empty B's have been processed, it starts at the bottom and deletes hidden rows.
    Please Login or Register  to view this content.
    Last edited by protonLeah; 01-18-2013 at 11:59 PM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    01-11-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Delete Multiple Rows Based on Criteria in 1 Column

    Thanks, but it just deletes my whole worksheet.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Delete Multiple Rows Based on Criteria in 1 Column

    It works on the sample with those many blank rows. Your actual must be significantly different than the sample...

    Try deleting the "+1" which expands the selection to the next row below the blank Bcell:
    Please Login or Register  to view this content.
    Or, upload a more accurate sample file.
    Last edited by protonLeah; 01-20-2013 at 02:37 AM.

  5. #5
    Registered User
    Join Date
    01-11-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Delete Multiple Rows Based on Criteria in 1 Column

    Thank you, I did get it to work. Thanks so much, you're a genius.

+ 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