If you have to delete a worksheet from a workbook, you can use below source code.

Source Code

1
2
3
4
5
6
7
8
9
10
' @Author - Alexander Bolte
' @ChangeDate - 2014-10-08
' @Description - Deleting a worksheet named like sheetName from given target Workbook, if a worksheet under given sheetName exists.
' @Param trg - an initialized workbook object.
' @Param sheetName - a String holding a unique worksheet name.
Public Function deleteWorksheet(ByRef trg As Workbook, ByVal sheetName As String)
    If worksheetExists(trg, sheetName) Then
        Call trg.Worksheets(sheetName).Delete
    End If
End Function

Referenced Functions

The following functions are referenced.

 Check if a worksheet exists