Look for cell containing "Initial" then if the next cell after equ
Maybe something like this. It goes bottom to top and looks for Final first.
If the cell above it says "Initial" then both rows are deleted.
Sub test()
Dim lRow As Long
Dim l As Long
lRow = Range("A65536").End(xlUp).Row
For l = lRow To 2 Step -1
If Range("A" & l).Value = "Final" And Range("A" & l - 1).Value =
"Initial" Then
Range(Range("A" & l), Range("A" & l - 1)).EntireRow.Delete
l = l - 1
End If
Next l
End Sub
--
Hope that helps.
Vergel Adriano
" wrote:
Hi everyone
I pretty much summed everything up above.
Thousands of rows of data most of which is useless but I thought the
best way to delete would be to find in column A the word "Initial" and
if the cell immediately after is "Final" delete both rows. If not
then this is a good row and it should continue until it finds the next
occurrence of "Initial"
I hope I make sense,
Thanks alot in advance,
Andrea
|