View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Locating if a Sheet is present in a workbook

on error resume next
application.displayalerts = false
sheets("Sheet1").Delete
application.displayalerts = true
on error goto 0

--
HTH...

Jim Thomlinson


"Shane" wrote:

Two Part Question:

I am looking for code that will locate if a sheet by a specific name is in
the workbook, and then delete it if it is. What is the easiest way to do
this? (I am not sure if an "IF" statement is the best way to go or not).

Secondly, is there a way to keep the warning pop-up from occurring when
trying to delete said sheet?

Thanks!