New error on code that has run correctly before...

Linda21

New Member
Joined
Aug 2, 2010
Messages
38
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
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Possibly there is a Break set
Next time it stops on End If;
Note if there is a highlighter line of sorts going all the way across combined with a Bullet in the left margin of the code;
if so F9 to toggle the Break off, and F5 to continue running
 
Upvote 0
Thanks, I tried, but no break is set. Any other thoughts of what would change code? I even went to a previous version of the spreadsheet and tried to run over. Errors again.
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,522
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top