Sub Delnames_00()
Dim i As Long
Dim LastCount As Long
Dim StartTime As Double
Dim SecondsElapsed As Double
LastCount = ActiveWorkbook.Names.Count
Debug.Print "Starting Count: " & ActiveWorkbook.Names.Count
Application.Calculation = xlCalculationManual
For i = 1 To ActiveWorkbook.Names.Count
ActiveWorkbook.Names(i).Delete
If i = 500 Then Exit For
Next i
Application.Calculation = xlCalculationAutomatic
SecondsElapsed = Round(Timer - StartTime, 2)
MsgBox "Batch done - Removed: " & LastCount - ActiveWorkbook.Names.Count & " named ranges " & vbNewLine & vbNewLine _
& "Run Time: " & Int(30 / SecondsElapsed) & " minutes and " & SecondsElapsed Mod 60 & " seconds"
End Sub
Sub Delnames_00()
Dim i As Long
Dim LastCount As Long
Dim StartTime As Double
StartTime = Timer
LastCount = ActiveWorkbook.Names.Count
Debug.Print "Starting Count: " & ActiveWorkbook.Names.Count
Application.Calculation = xlCalculationManual
For i = 1 To ActiveWorkbook.Names.Count
ActiveWorkbook.Names(i).Delete
If i = 500 Then Exit For
Next i
Application.Calculation = xlCalculationAutomatic
MsgBox "Batch done - Removed: " & LastCount - ActiveWorkbook.Names.Count & " named ranges " & vbNewLine & vbNewLine _
& "Run Time: " & Format$((Timer - StartTime) / 86400, "h:mm:ss") & " h:mm:ss"
End Sub