ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Row Delete (https://www.excelbanter.com/excel-programming/310231-conditional-row-delete.html)

Sparky[_2_]

Conditional Row Delete
 
I have a large worksheet that I must modify on a semi-annual basis.

One of the mods requires the deletion of Rows where a cell in the
row meets a criteria. For example: Cell "E" within the Row contains
"2XL" then I want to delete the entire row and move to the next row.

Thanks for any help.

----------------------------------------------
Posted with NewsLeecher v1.0 beta 32 (RC3)
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------


Tom Ogilvy

Conditional Row Delete
 
Sub AAA()
Dim rng As Range, rng1 As Range
Set rng = Range(Cells(1, "E"), Cells(Rows.Count, "E"))
Set rng1 = rng.Find("2XL")
If Not rng1 Is Nothing Then
Do
rng1.EntireRow.Delete
Set rng1 = rng.Find("2XL")
Loop While Not rng1 Is Nothing
End If


--
Regards,
Tom Ogilvy





"Sparky" wrote in message
...
I have a large worksheet that I must modify on a semi-annual basis.

One of the mods requires the deletion of Rows where a cell in the
row meets a criteria. For example: Cell "E" within the Row contains
"2XL" then I want to delete the entire row and move to the next row.

Thanks for any help.

----------------------------------------------
Posted with NewsLeecher v1.0 beta 32 (RC3)
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------




Sparky[_2_]

Conditional Row Delete
 
Worked great. THANKS!

----------------------------------------------
Posted with NewsLeecher v1.0 beta 32 (RC3)
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------



All times are GMT +1. The time now is 05:34 PM.

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