20 | 09 | 2017

Delete all worksheets

Sub DeleteAllWorkSheets(Byval wrkbk as Workbook)

Dim I As Integer

Application.ScreenUpdating = False
Application.DisplayAlerts = False

For I = wrkbk .Worksheets.Count To 1 Step -1
If wrkbk (I).Name <> "Sheet1" Then wrkbk (I).Delete
Next I

Application.ScreenUpdating = True
Application.DisplayAlerts = True

 End Sub
Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2353608
Latest Articles