Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Deleting worksheets in a macro

I have a macro that at the end there are 2 work sheets that I delete.
When the macro runs, it stops and asks if I really want to delete the
worksheets. Is there something I can add so that it will not ask me if I
want to delete?
Here is what I have.

Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
Thanks Donna
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 506
Default Deleting worksheets in a macro

Have a look in the below link for details and I hope that you will get some
idea.

http://www.microsoft.com/office/comm...1-898dc1f0d288

--------------------
(Ms-Exl-Learner)
--------------------


"Donna" wrote:

I have a macro that at the end there are 2 work sheets that I delete.
When the macro runs, it stops and asks if I really want to delete the
worksheets. Is there something I can add so that it will not ask me if I
want to delete?
Here is what I have.

Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
Thanks Donna

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Deleting worksheets in a macro

Further you dont need to select the sheets; instead you could try

Application.DisplayAlerts = False
Worksheets(Array("Sheet2","Sheet3")).Delete
Application.DisplayAlerts = True

--
Jacob


"Donna" wrote:

I have a macro that at the end there are 2 work sheets that I delete.
When the macro runs, it stops and asks if I really want to delete the
worksheets. Is there something I can add so that it will not ask me if I
want to delete?
Here is what I have.

Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
Thanks Donna

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
Macro for Deleting Worksheets andiam24 Excel Discussion (Misc queries) 2 April 2nd 09 03:47 PM
Deleting worksheets David Excel Discussion (Misc queries) 2 January 19th 07 08:19 PM
Deleting blank worksheets Lvenom Excel Worksheet Functions 3 June 15th 06 12:28 AM
Prompt before deleting worksheets? cbrooks421 Excel Discussion (Misc queries) 2 July 20th 05 05:32 AM
Help deleting worksheets Wilhelmutt Excel Discussion (Misc queries) 2 April 19th 05 03:23 AM


All times are GMT +1. The time now is 08:52 PM.

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"