OilEconomist
Active Member
- Joined
- Dec 26, 2016
- Messages
- 439
- Office Version
- 2019
- Platform
- Windows
Thanks in advance for any suggestions which I will provide feedback.
Why does nothing happens when I run the following code as I'm trying delete all the sheets between the "Start" and "End" sheets?
Why does nothing happens when I run the following code as I'm trying delete all the sheets between the "Start" and "End" sheets?
Code:
Sub DltShts()
'Dimensioning
Dim i As Long
'Turn off Screen Update
Application.ScreenUpdating = False
'Turn off Automatic Calculation
Application.Calculation = xlManual
'Delete sheets between "START" and "END"
With ActiveWorkbook
For i = .Worksheets("START").Index To .Worksheets("END").Index Step -1
.Worksheets(i).Delete
Next i
End With
'Turn on Screen Update
Application.DisplayAlerts = True
End Sub