markf5998,
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code, by highlighting the code and pressing the keys
CTRL +
C
2. Open your workbook
3. Press the keys
ALT +
F11 to open the Visual Basic Editor
4. Press the keys
ALT +
I to activate the Insert menu
5. Press
M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys
CTRL +
V
7. Press the keys
ALT +
Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press
ALT +
F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Code:
Option Explicit
Sub DeleteSheets()
' hiker95, 03/17/2011
' http://www.mrexcel.com/forum/showthread.php?t=536882
Dim a As Long, SN As String
With Application
.ScreenUpdating = False
.DisplayAlerts = False
For a = 1 To 50 Step 1
SN = a
If Worksheets(SN).Range("E2") = "" Then Worksheets(SN).Delete
Next a
.DisplayAlerts = True
.ScreenUpdating = True
End With
End Sub
Then run the DeleteSheets macro.