Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Deleting sheets

I want a command button that deletes all sheets except the one named Master
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Deleting sheets

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Deleting sheets

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
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 Custom Views when Deleting Sheets ExcelMonkey Excel Programming 1 March 28th 07 06:11 AM
Deleting sheets Brian Matlack[_61_] Excel Programming 3 March 31st 06 07:03 PM
Deleting all sheets except one Nirmal Singh[_2_] Excel Programming 2 January 26th 06 03:57 PM
Deleting Sheets ExcelMonkey[_190_] Excel Programming 1 March 25th 05 10:02 AM
Deleting Sheets Jordan[_3_] Excel Programming 4 February 13th 04 03:19 PM


All times are GMT +1. The time now is 02:48 PM.

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

About Us

"It's about Microsoft Excel"