JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Can anyone help me understand why I'm getting an error message
"Code execution has been interrupted"
on the last line of the code below when I run the macro? F8/stepping through it works fine:
"Code execution has been interrupted"
on the last line of the code below when I run the macro? F8/stepping through it works fine:
Rich (BB code):
Sub DMISHemaSynch()
Dim LR As Long
Dim rng As Range
With Application
.ScreenUpdating = True
.DisplayAlerts = False
End With
Dim i As Long, j As Long
j = Worksheets.Count
For i = 1 To j
Select Case Sheets(i).Name
Case "Hema", "Baseline DMIS", "Audit DMIS"
Case Else
Sheets(i).Delete
i = i - 1
End Select
If i >= Worksheets.Count Then Exit For
Next i
Sheets.Add before:=Sheets(1)
ActiveSheet.Name = "Indeterminate Info"
Sheets.Add
ActiveSheet.Name = "Resolve Hemasphere Duplicates"
Sheets.Add
ActiveSheet.Name = "Not in Hemasphere"
With Sheets("Hema")
.Select
If .AutoFilterMode Then .AutoFilterMode = False
LR = .Range("A" & Rows.Count).End(xlUp).Row
With .Range("E2")
.Formula = "=COUNTIF($A$2:$A$" & LR & ",A2)"
.AutoFill Range("E2:E" & LR)
End With