Tuesday, January 8, 2008

Delete sheets without confirmation prompts using VBA in Excel

Hi people,

i was searching for a way to delete a worksheet without confirmation prompt in vba and i found this link.
the code is listed here:


Sub DeleteSheet(strSheetName As String)
' deletes a sheet named strSheetName in the active workbook
Application.DisplayAlerts = False
Sheets(strSheetName).Delete
Application.DisplayAlerts = True
End Sub

No comments: