Today we will learn how to delete a selected Sheet from a Workbook. First we need to traverse all the sheets of the workbook to check whether the sheet with the given name exists in the workbook. If not, then we should throw an error otherwise go ahead and delete the given sheet.

Sub DeleteSheet(VariableSheetName)

'----Before deleting any sheet in to workbook we need to make sure that sheet is already there in the work book.

Dim SheetExists as Boolean
SheetExists = False
For Each Sheet In Sheets
 If Ucase(Sheet.Name ) = Ucase(VariableSheetName) Then
SheetExists = True
End If
Next Sheet

If (SheetExists = True) Then

'--To disable Excel Warning for deleting any Sheets

Application.DisplayAlerts = False
Worksheets.delete (VariableSheetName)
MsgBox("Selected Sheet is successfully deleted")

'---Now Enable the Alerts

Application.DisplayAlerts = True
MsgBox("This Sheet is not there")

End Sub