Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That was PERFECT!!! Thx MUCH!! -----Original Message----- The following example deletes sheets "Sheet5", "Sheet4", "Sheet1" if they exist. You can easily modify to accomodate your sheet names and number. Sub delete_sheets() Dim sh(3) As String sh(1) = "Sheet5" sh(2) = "Sheet4" sh(3) = "Sheet1" On Error Resume Next Application.DisplayAlerts = False For i = 1 To 3 Sheets(sh(i)).Delete Next Application.DisplayAlerts = True On Error GoTo 0 End Sub Nikos Y. (nyannaco at in dot gr) -----Original Message----- I am trying to create a small procedure to delete worksheets if they are present. What is the code to test if said sheet exists, and then delete it if it exists? Thx MUCH in advance, Al . . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for Deleting Worksheets | Excel Discussion (Misc queries) | |||
Deleting worksheets | Excel Discussion (Misc queries) | |||
Deleting blank worksheets | Excel Worksheet Functions | |||
Help deleting worksheets | Excel Discussion (Misc queries) |