Hi Team,
I want to delete all rows where cells value <> "Keep" and <> "#N/A"
20000 rows want to delete. I used autofilter, loop, it worked,
Trying to learn new and multiple ways ....
Below code I got from this forum. its very fast
How to fit my requirement into below logic and delete entire row.
Below is dummy Column A.
Thanks
mg
I want to delete all rows where cells value <> "Keep" and <> "#N/A"
20000 rows want to delete. I used autofilter, loop, it worked,
Trying to learn new and multiple ways ....
Below code I got from this forum. its very fast
How to fit my requirement into below logic and delete entire row.
VBA Code:
Sub Cobalt()
Dim Ary As Variant
Dim i As Long
Ary = Array("superseded", "inactive", "defunct")
For i = 0 To UBound(Ary)
Range("K:K").Replace Ary(i) & "*", True, xlWhole, , False, , False, False
Next i
Range("K:K").SpecialCells(xlConstants, xlLogical).EntireRow.Delete
End Sub
Below is dummy Column A.
Book5 | ||||
---|---|---|---|---|
A | B | |||
1 | Data | |||
2 | Overdue | delete | ||
3 | Keep | |||
4 | Overdue | delete | ||
5 | #N/A | |||
6 | #N/A | |||
7 | #N/A | |||
8 | #N/A | |||
9 | Keep | |||
10 | Overdue | delete | ||
11 | #N/A | |||
12 | Paid | delete | ||
13 | Keep | |||
14 | #N/A | |||
15 | #N/A | |||
16 | Keep | |||
17 | Pending | delete | ||
18 | Keep | |||
19 | Keep | |||
20 | #N/A | |||
Sheet1 |
Thanks
mg