I have a fairly simple code to copy some cells down after a countif = 0, but some reason this just stalls and when i hit escape it throws an error to the end if?
VBA Code:
Sub NewSpineTable()
Dim I As Long, LR As Long
I = 2
Do While Worksheets("Network Data").Cells(I, 14) <> ""
LR = Worksheets("Spine Summary").Range("E" & Rows.Count).End(xlUp).Row
If Application.WorksheetFunction.CountIf(Worksheets("Spine Summary").Range("D2:D" & LR), Worksheets("Network Data").Cells(I, 14) = 0) Then
MsgBox "TRUE"
LR = Worksheets("Spine Summary").Range("E" & Rows.Count).End(xlUp).Row + 1
Worksheets("Spine Summary").Range("A2:T3").Copy Worksheets("Spine Summary").Range("A" & LR)
Worksheets("Spine Summary").Range("A:" & LR & ":C" & LR + 1).ClearContents
I = I + 1
End If
Loop
End Sub