Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting sheets 2&3 doug53098 Excel Discussion (Misc queries) 2 July 7th 05 08:22 PM
deleting sheets KLP Excel Discussion (Misc queries) 3 January 14th 05 12:24 AM
Deleting nonactive Sheets in Excell Bernie Deitrick Excel Programming 0 August 31st 04 02:31 PM
Deleting sheets Gary Adamson[_2_] Excel Programming 2 October 30th 03 07:24 PM
deleting sheets david Excel Programming 2 July 31st 03 01:02 AM


All times are GMT +1. The time now is 05:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"