remove the unwanted space after the sheet name and quote mark - happened
when I copied the names.
Application.DisplayAlerts=False
Worksheets("PLANID").Delete
Worksheets("FEETOTAL").Delete
Application.DisplayAlerts=True
For Each ws In ThisWorkbook.Worksheets
With Application
.DisplayAlerts = False
With ws
If .Name = "PLANID" Or .Name = "FEETOTAL" Then
.Delete
End If
End With
.DisplayAlerts = True
End With
Next
End Sub
For Each ws In ThisWorkbook.Worksheets
With Application
.DisplayAlerts = False
With ws
If .Name = "PLANID" Or .Name = "FEETOTAL" Then
.Delete
End If
End With
.DisplayAlerts = True
End With
Next
End Sub
Sub Macro()
Application.DisplayAlerts = False
Sheets("Sheet2").Delete
'To delete more than one sheet
'Sheets(Array("Sheet2", "Sheet3")).Delete
Application.DisplayAlerts = True
End Sub
Sub Macro()
Application.DisplayAlerts = False
Sheets("PLANID").Delete
'to delete both
'Sheets(Array("PLANID","FEETOTAL")).Delete
Application.DisplayAlerts = True
End Sub