This code does not work. I am trying to remove some page breaker lines. I am using this code to search the word caepipe and select a couple lines below that then delete, and hope that the loop would continue until it finish removing those lines. What could be wrong? The code runs fine, but just doesn't remove anything. Thanks.
'Look for Row Numbers
With Worksheets("Coordinates")
startRow = Worksheets("a").Columns("B").Find(What:="coordinates", _
LookIn:=xlValues, LookAt:=xlWhole).Row
startRow = startRow + 4
stopRow = Worksheets("a").Columns("B").Find(LargestNode, _
LookIn:=xlValues, LookAt:=xlWhole).Row
' Copy and Paste Results to New Location
Worksheets("a").Range("B" & startRow & ":F" & stopRow).Copy _
Destination:=Worksheets("Coordinates").Range("A1")
' Delete Useless Info Between data
CoordinateLastRow = ActiveSheet.UsedRange.Rows.Count
For CoordinateStartRow = 1 To CoordinateLastRow Step 1
If Cells(CoordinateStartRow, 1) = "Caepipe" Then
CoordinateEndRow = CoordinateStartRow + 7
Worksheets("Coordinates").Range("A" & CoordinateStartRow & ":E" & CoordinateEndRow).Select
Selection.Delete
Else: End If
Next CoordinateStartRow
End With