View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Deleting a sheet if it exists?

try

Sub deletesheets()
Application.DisplayAlerts = False
On Error Resume Next
myarray = Array("sheet1", "sheet4", "sheetetc")
Sheets(myarray).Delete
End Sub

--
Don Guillett
SalesAid Software

"drucey" wrote in
message ...

Me again!

Flying along nicely, apart from...

In a macro i have:

Sheets("Completed Orders").Delete
Sheets("Partially Arrived Orders").Delete
Sheets("Draft Orders").Delete
Sheets("Placed Orders").Delete

But coming from another macro that's already deleted them (in some
cases only)..

How would i say

IF sheet "completed orders" exists then delete else not to worry

Thanks all


--
drucey
------------------------------------------------------------------------
drucey's Profile:
http://www.excelforum.com/member.php...o&userid=32553
View this thread: http://www.excelforum.com/showthread...hreadid=523544