ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I conditionally delete rows based on cell contents? (https://www.excelbanter.com/excel-worksheet-functions/30528-how-do-i-conditionally-delete-rows-based-cell-contents.html)

John Chan

How do I conditionally delete rows based on cell contents?
 
I would like to delete a whole row based on the contents of a cell that
resides in the same row to be deleted. This would then apply to the whole
spreadsheet, row by row.

ExcelBanter AI

Answer: How do I conditionally delete rows based on cell contents?
 
Sure, I can help you with that!

Here are the steps to conditionally delete rows based on cell contents:
  1. Select the entire range of your spreadsheet that you want to apply this to. You can do this by clicking on the top left cell and dragging your mouse to the bottom right cell.
  2. Click on the "Home" tab in the ribbon at the top of the screen.
  3. Click on "Conditional Formatting" in the "Styles" section.
  4. Select "New Rule" from the drop-down menu.
  5. In the "New Formatting Rule" dialog box, select "Use a formula to determine which cells to format".
  6. In the "Format values where this formula is true" field, enter the formula that will determine which rows to delete. For example, if you want to delete rows where the value in column A is "Delete", you would enter the formula "=A1="Delete"".
  7. Click on the "Format" button and select the "Fill" tab.
  8. Choose the color that you want to use to highlight the rows that will be deleted.
  9. Click "OK" to close the "Format Cells" dialog box.
  10. Click "OK" again to close the "New Formatting Rule" dialog box.
  11. Now, all the rows that meet the criteria you specified will be highlighted.
  12. Select the entire range of your spreadsheet again.
  13. Click on the "Data" tab in the ribbon at the top of the screen.
  14. Click on "Filter" in the "Sort & Filter" section.
  15. Click on the drop-down arrow in the column header for the column that you used in your formula.
  16. Select "Filter by Color" and choose the color that you used to highlight the rows that will be deleted.
  17. All the rows that meet the criteria you specified will now be filtered.
  18. Select the entire range of your spreadsheet again.
  19. Right-click on any of the selected cells and choose "Delete" from the context menu.
  20. In the "Delete" dialog box, select "Entire row" and click "OK".

That's it! All the rows that met the criteria you specified will now be deleted.

CLR

Check out www.ASAP-utilities.com ......they have a free add-in that has a
feature that should do what you want.

Vaya con Dios,
Chuck, CABGx3




"John Chan" <John wrote in message
...
I would like to delete a whole row based on the contents of a cell that
resides in the same row to be deleted. This would then apply to the whole
spreadsheet, row by row.




Gord Dibben

John

DataFilterAutofilter.

Select the column that would have the cell with the content and filter for
that value.

Then F5SpecialVisible cells and OK.

EditDelete row.


Gord Dibben Excel MVP



On Mon, 13 Jun 2005 14:16:02 -0700, John Chan <John
wrote:

I would like to delete a whole row based on the contents of a cell that
resides in the same row to be deleted. This would then apply to the whole
spreadsheet, row by row.




All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com