PC Review


Reply
Thread Tools Rate Thread

Deleting sheets

 
 
oldjay
Guest
Posts: n/a
 
      30th Nov 2009
I want a command button that deletes all sheets except the one named Master
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      30th Nov 2009
Try the below

Dim ws As Worksheet
Application.DisplayAlerts = False
For Each ws In Sheets
If ws.Name <> "Master" Then ws.Delete
Next
Application.DisplayAlerts = True

--
Jacob


"oldjay" wrote:

> I want a command button that deletes all sheets except the one named Master

 
Reply With Quote
 
oldjay
Guest
Posts: n/a
 
      30th Nov 2009
Thanks

"Jacob Skaria" wrote:

> Try the below
>
> Dim ws As Worksheet
> Application.DisplayAlerts = False
> For Each ws In Sheets
> If ws.Name <> "Master" Then ws.Delete
> Next
> Application.DisplayAlerts = True
>
> --
> Jacob
>
>
> "oldjay" wrote:
>
> > I want a command button that deletes all sheets except the one named Master

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Deleting Custom Views when Deleting Sheets NickHK Microsoft Excel Programming 0 28th Mar 2007 06:11 AM
Deleting sheets TK Microsoft Excel Programming 2 31st Aug 2005 06:02 AM
deleting sheets =?Utf-8?B?S0xQ?= Microsoft Excel Misc 3 14th Jan 2005 12:24 AM
Deleting Sheets with @ ianripping Microsoft Excel Misc 3 17th Jan 2004 01:48 PM
Deleting sheets Denny Microsoft Excel Misc 3 11th Oct 2003 05:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:00 PM.