Delete all even Numbered Wrkshts

Hi All

Need help. I have a workbook with worksheet that are named with sequential numbers. i.e worksheet names 1,2,3,4,5,6,7,8,...... I would like a macro that deletes all the
worksheets with names that are even numbers.

Thanking you in advance

Nick's picture

Delete Even Worksheets

Sub DeleteEvenWorksheets()
 
On Error Resume Next
Application.DisplayAlerts = False
For Each theSheet In ActiveWorkbook.Sheets
    If theSheet.Name Mod 2 = 0 Then
        theSheet.Delete
    End If
Next
Application.DisplayAlerts = True
 
End Sub

Works perfectly

Thanks Nick

Works perfectly

Regards
Walter