K
Keyrookie
Need some help...
I'm trying to find ANY text in a column and then delete the entire row.
In other words, if there is text in B3, B8, B16, etc., I want to find
the macro to find it and then delete the rows 3, 8, 16, etc. These are
not actual rows, just examples. I tried the following macro but it
doesn't work. I tried to use a wildcard character to locate text in
column B because that text is not a constant. I think I'm close but I
need this to be corrected.
Thanks for your help.
Sub Delete_Zero_Rows()
Dim lastrow As Long, r As Long
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
For r = lastrow To 1 Step -1
If Cells(r, "B") = (item*) Then
Rows(r).EntireRow.Delete
End If
Next r
End Sub
I'm trying to find ANY text in a column and then delete the entire row.
In other words, if there is text in B3, B8, B16, etc., I want to find
the macro to find it and then delete the rows 3, 8, 16, etc. These are
not actual rows, just examples. I tried the following macro but it
doesn't work. I tried to use a wildcard character to locate text in
column B because that text is not a constant. I think I'm close but I
need this to be corrected.
Thanks for your help.
Sub Delete_Zero_Rows()
Dim lastrow As Long, r As Long
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
For r = lastrow To 1 Step -1
If Cells(r, "B") = (item*) Then
Rows(r).EntireRow.Delete
End If
Next r
End Sub