12 Apr 12 11:22
I wrote a quick script to delete useless rows in a monstrous table that don't apply to the situation I am looking for. For some reason the macro keeps breaking into debug mode at the .Row(F).Delete line. It gives me the message, "Code execution has been inturrupted." I can click the 'Continue' button, but after the 70th time clicking this button my index finger begins to instigate a rebellion among fingers. I suppose if I were clicking with my middle finger this would not be a problem, because my middle finger is exercised quite often in traffic. Anyway, this is quite perplexing, because it was running fine all day yesterday when I was chopping down other tables, but then it started suddenly and without warning. Now anytime the command ".Rows(F).Delete" is executed in this workbook it breaks into debug mode, regardless of which worksheet I am chopping. Any ideas?
Dim F As Long
Dim lngREnd As Long
Dim intSICCol As Integer
'Dim intDateCol As Integer
Dim strCatch As String
intSICCol = LocateColumn("SIC_RateLoss", wksC704Shut)
'intDateCol = LocateColumn("enddate", wksC301MinData)
lngREnd = LastRow(wksC704Shut)
Application.ScreenUpdating = False
For F = lngREnd To 2 Step -1
strCatch = LCase(Trim(CStr(.Cells(F, intSICCol))))
If strCatch <> "process misc" And strCatch <> "extrusion" Then
On Error Resume Next
On Error GoTo 0
Debug.Print "Progress: " & Round((lngREnd - F) / lngREnd * 100, 2) & "%"
Application.ScreenUpdating = True
If it's not broken, it doesn't have enough parts yet.