Macro to delete sheets in Excel


Delete the specified Worksheet (Sheet1)


Sub DeleteSheet()
Sheets("Sheet1").Delete
End Sub

Delete Worksheet based on user input


Sub DeleteSheetUserInput()
Dim x As String
x = InputBox("Enter the name of the sheet to be deleted")
Sheets(x).Delete
End Sub

How to use codes shared here?