View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Deleting nonactive Sheets in Excell

Dim sh1 as object, sh as object
On Error Resume Next
set sh1 = Activeworkbook.worksheets("Data Input")
On Error goto 0
if not sh1 is nothing then
for each sh in Activeworkbook.Sheets
if lcase(sh.name) < "data input" then
Application.displayAlerts = False
sh.Delete
Application.DisplayAlerts = true
End if
Next
Else
msgbox "this workbook does not contain data input"
End if
--

Regards,
Tom Ogilvy

"Ben H" <Ben wrote in message
...
Hi all. Basically, I need to be able to delete all hte sheets in a open
workbook except for the sheet called "Data Input". The rest of the sheets
will have different names, but most likely "Data Output" (orginal, isn't

it?)

Any ideas would greatly help.

Thanks