Code – Sort Worksheets Alphabetically

Sub SortSheetbyName() Application.ScreenUpdating = False Dim ShCount As Integer, i As Integer, j As Integer ShCount = Sheets.Count For i = 1 To ShCount – 1 For j = i + 1 To ShCount If Sheets(j).Name < Sheets(i).Name Then Sheets(j).Move before:=Sheets(i) End If Next j Next i Application.ScreenUpdating = True MsgBox “All sheets sorted!” End…

Code – Delete active workbook

Sub DeleteActiveWorkbook() If Application.ProtectedViewWindows.Count > 0 Then Application.ActiveProtectedViewWindow.Edit End IfDim xFullName As String xFullName = Application.ActiveWorkbook.FullName ActiveWorkbook.Saved = True Application.ActiveWorkbook.ChangeFileAccess xlReadOnly Kill xFullName Application.ActiveWorkbook.Close False End Sub