View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Andrew Taylor Andrew Taylor is offline
external usenet poster
 
Posts: 225
Default If sheet exists, then...

There's no need to select the sheet before deleting it
(and doing so "forgets" your current selection).

On Error Resume Next
Application.DisplayAlerts = False
ActiveWorkbook.Sheets("xyz").Delete
Application.DisplayAlerts = True
On Error Goto 0

Darin Kramer wrote:
Hi there,

Im looking for some simple VB that says if sheet xyz exist, then select
sheet and delete it, or else call Macro 1.

Any ideas...

Thanks!!!!

Darin

*** Sent via Developersdex http://www.developersdex.com ***