This code has worked perfectly until 1 hour ago. It will run if I hold down the F8 code. However, when I run with F5, it get the error: Code execution has been interrupted. The 'End if' row is highlighted. If I hit 'continue' the code works correctly. However there is over 20,000 rows of data to read through and I don't have time. Thank you.
' section below loops through all raw data from first export until "Grand Totals" is found
' if column B = "Budget" or is empty, delete the row
D_Row = 2 ' start row
BudgetCol = 2 ' column that contains 'Budget'
ColBValue = detail.Cells(D_Row, BudgetCol).Value
Do Until detail.Cells(D_Row, 1) = "Grand Totals"
ColBValue = detail.Cells(D_Row, BudgetCol).Value
If detail.Cells(D_Row, BudgetCol) = "Budget" Then
Rows(D_Row).Delete 'delete row
ElseIf IsEmpty(detail.Cells(D_Row, BudgetCol)) Then
Rows(D_Row).Delete
Else
D_Row = D_Row + 1
End If
Loop
End Sub
' section below loops through all raw data from first export until "Grand Totals" is found
' if column B = "Budget" or is empty, delete the row
D_Row = 2 ' start row
BudgetCol = 2 ' column that contains 'Budget'
ColBValue = detail.Cells(D_Row, BudgetCol).Value
Do Until detail.Cells(D_Row, 1) = "Grand Totals"
ColBValue = detail.Cells(D_Row, BudgetCol).Value
If detail.Cells(D_Row, BudgetCol) = "Budget" Then
Rows(D_Row).Delete 'delete row
ElseIf IsEmpty(detail.Cells(D_Row, BudgetCol)) Then
Rows(D_Row).Delete
Else
D_Row = D_Row + 1
End If
Loop
End Sub