+ Reply to Thread
Results 1 to 3 of 3

Delete row IF

  1. #1
    Registered User
    Join Date
    03-12-2006
    Posts
    3

    Delete row IF

    is there a way to delete an entire row if it meets some criteria? like if a cell in that row has a value of 1, can i make it so it deletes that row and doesn't delete the ones that don't?

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Yes but you need to use macros or filtering and perhaps help columns

    If you created a help column with the criteria in, if it spanned a whole row, then data,auto filter and select the criteria, select all the rows and delete

    With out more inforamtion it is hard to be more specific

    Regards

    Dav

  3. #3
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by Sabrick
    is there a way to delete an entire row if it meets some criteria? like if a cell in that row has a value of 1, can i make it so it deletes that row and doesn't delete the ones that don't?
    click on any cell in col A, right click, click Insert... and select entire column
    (this will Insert new col that will be col A)
    put in cell A1
    =IF(COUNTIF(B1:IV1,"=1")>0,"","Ok") and copy it down in col A to the extent you have data in other columns.
    it will show Ok if 1 is not found in any cell of that row and blank cell if 1 is found in any cell of that row.
    now select col A, copy it, right click, click Paste special and select Values and press Ok.
    select col A again, press F5, click on Special tab and select Blanks and Ok (it will select blank cells in col A which infact shows that these rows have not 1 in any cell)
    now right click on any selected cell, click Delete... and select Entire row and Ok.
    it will delete all rows that do not have 1 in any of its cells.
    now you can also delete col A.

    Regards

+ 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