K
kkondrat1
Hello, I have two columns with data that I need to use to filte
out/delete rows.
columns C and K
I want to delete all rows that contain "H72" in column C AND contai
"H73" in column K.
This is what I am using, which works great for one column:
Sub Delete_Rows()
Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("C:C"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "H72" _ Then
If del Is Nothing Then
Set del = cell
Else: Set del = Union(del, cell)
End If
End If
Next cell
On Error Resume Next
del.EntireRow.Delete
End Su
out/delete rows.
columns C and K
I want to delete all rows that contain "H72" in column C AND contai
"H73" in column K.
This is what I am using, which works great for one column:
Sub Delete_Rows()
Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("C:C"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "H72" _ Then
If del Is Nothing Then
Set del = cell
Else: Set del = Union(del, cell)
End If
End If
Next cell
On Error Resume Next
del.EntireRow.Delete
End Su