I want to do the following:
- Search column B for a value...let's say "X"
- Continue to search the rest of column B, after you've found X, and do the following:
- If (i,B) = vbNullString -> Do Nothing
- If (i,B) = any other value -> delete all rows from that row down
Here's a rough outline of what I'm thinking, but it's not working.
Sub TEST()
Dim LastRow As Long
Dim Target As Long
Dim i As Integer
LastRow = LastRow = Range("A" & Rows.Count).End(xlUp).Row
Target = Application.WorksheetFunction.Match("X", Range("B1:B" & LastRow), 0) + 1
For i = Target To LastRow Step 1
If Cells(i, 2) = vbNullString Then
'Do Nothing
Else
Range("Cells(i,1):F" & LastRow).Delete
i = LastRow
End If
Next i
End Sub
This doesn't seem to do anything though...
Bookmarks