I cannot figure out why my row copy macro goes out of control and copies the same row 100 times to the point it crashes. My code is :
It fails on the
line.
Any ideas?
Code:
Private Sub Worksheet_Activate()
Dim i As Long
Dim LR As Long
LR = Sheets("OpenIssues").Range("B" & Rows.Count).End(xlUp).Row
For i = 7 To LR
If Sheets("OpenIssues").Range("D" & i) = "Closed" And Sheets("OpenIssues").Range("L" & i) > 0 Then
Sheets("OpenIssues").Rows(i).Copy
Sheets("ClosedIssues").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValuesAndNumberFormats
End If
Next i
For i = 7 To LR
If Sheets("OpenIssues").Range("D" & i) = "Closed" And Sheets("OpenIssues").Range("L" & i) > 0 Then
Sheets("OpenIssues").Rows(i).EntireRow.Delete
End If
Next i
Exit Sub
It fails on the
Code:
Sheets("OpenIssues").Rows(i).Copy
Any ideas?